IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 35842


Ignore:
Timestamp:
Jul 18, 2013, 2:18:47 PM (13 years ago)
Author:
eugene
Message:

handle empty message

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20130711/Ohana/src/libkapa/src/IOfuncs.c

    r35761 r35842  
    5454  va_end (argp);
    5555
    56   if (!Nbyte) return (FALSE);
     56  if (!Nbyte) {
     57    KiiSendCommand (device, 16, "LEN: %11d", 0);
     58    return (FALSE);
     59  }
    5760
    5861  /* the message may contain up to 99,999,999,999 bytes (100MB) */
     
    8487  /* find the message length, allocate space */
    8588  sscanf (buffer, "%*s %d", &Nbytes);
     89  if (Nbytes == 0) {
     90    return TRUE;
     91  }
     92
    8693  ALLOCATE (message, char, Nbytes + 1);
    8794  memset (message, 0, Nbytes + 1);
     95
    8896
    8997  /* read Nbytes from the device */
Note: See TracChangeset for help on using the changeset viewer.