IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 42136


Ignore:
Timestamp:
Mar 21, 2022, 3:57:14 PM (4 years ago)
Author:
eugene
Message:

do not segfault if errorlines is not yet allocated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/libohana/src/errors.c

    r41468 r42136  
    2626
    2727int push_error (char *line) {
     28
     29  if (!errorlines) {
     30    NLINE = 10;
     31    ALLOCATE (errorlines, char *, NLINE);
     32    for (int i = 0; i < NLINE; i++) {
     33      errorlines[i] = NULL;
     34    }
     35  }
    2836
    2937  errorlines[Nline] = strcreate (line);
Note: See TracChangeset for help on using the changeset viewer.