IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 39060 for trunk


Ignore:
Timestamp:
Nov 6, 2015, 10:53:44 AM (11 years ago)
Author:
eugene
Message:

forgot to add quotes around the float and double

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/tools/src/fits_to_mysql.c

    r39059 r39060  
    311311  char output[128]; // I can use a fixed-length buffer since sprintf_double prints no more than 22 bytes;
    312312
    313   int Nbyte = sprintf_double (output, value);
     313  output[0] = 0x27;
     314  int Nbyte = sprintf_double (&output[1], value);
     315  output[Nbyte+1] = 0x27; // 'asdf' : 012345
     316  output[Nbyte+2] = 0;
     317  Nbyte += 2;
    314318
    315319  if (buffer[0].Nbuffer + Nbyte + 1 >= buffer[0].Nalloc) {
     
    319323
    320324  strcpy (&buffer[0].buffer[buffer[0].Nbuffer], output);
    321   buffer[0].Nbuffer += Nbyte;
     325  buffer[0].Nbuffer += Nbyte; // buffer[Nbuffer] is the EOL null byte
    322326
    323327  return (TRUE);
     
    331335  char output[128]; // I can use a fixed-length buffer since sprintf_float prints no more than 14 bytes;
    332336
    333   int Nbyte = sprintf_float (output, value);
     337  output[0] = 0x27;
     338  int Nbyte = sprintf_float (&output[1], value);
     339  output[Nbyte+1] = 0x27; // 'asdf' : 012345
     340  output[Nbyte+2] = 0;
     341  Nbyte += 2;
    334342
    335343  if (buffer[0].Nbuffer + Nbyte + 1 >= buffer[0].Nalloc) {
     
    339347
    340348  strcpy (&buffer[0].buffer[buffer[0].Nbuffer], output);
    341   buffer[0].Nbuffer += Nbyte;
     349  buffer[0].Nbuffer += Nbyte; // buffer[Nbuffer] is the EOL null byte
    342350
    343351  return (TRUE);
Note: See TracChangeset for help on using the changeset viewer.