Changeset 42fd3ef in git


Ignore:
Timestamp:
07/03/15 10:38:29 (5 years ago)
Author:
Olly Betts <olly@…>
Branches:
line_contents, master, stereo, travis-osx
Children:
a46e1ec
Parents:
c8fcf66
Message:

src/message.c: Don't dynamically generate a message string for a
message requested before messages are read or for an out of range
message number - instead return a fixed string and write the
message number to STDERR.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    rc8fcf66 r42fd3ef  
     1Sat Mar 07 10:36:43 GMT 2015  Olly Betts <olly@survex.com>
     2
     3        * src/message.c: Don't dynamically generate a message string for a
     4          message requested before messages are read or for an out of range
     5          message number - instead return a fixed string and write the
     6          message number to STDERR.
     7
    18Sat Mar 07 10:03:37 GMT 2015  Olly Betts <olly@survex.com>
    29
  • src/message.c

    rc8fcf66 r42fd3ef  
    11921192{
    11931193   /* NB can't use SVX_ASSERT here! */
    1194    static char badbuf[256];
    11951194   if (dontextract && en >= 1000 && en < 1000 + N_DONTEXTRACTMSGS)
    11961195      return dontextract[en - 1000];
    11971196   if (!msg_array) {
    11981197      if (en != 1)  {
    1199          sprintf(badbuf, "Message %d requested before fully initialised\n", en);
    1200          return badbuf;
     1198         fprintf(STDERR, "Message %d requested before fully initialised\n", en);
     1199         return "Message requested before fully initialised\n";
    12011200      }
    12021201      /* this should be the only other message which can be requested before
     
    12081207
    12091208   if (en < 0 || en >= num_msgs) {
    1210       sprintf(badbuf, "Message %d out of range\n", en);
    1211       return badbuf;
     1209      fprintf(STDERR, "Message %d out of range\n", en);
     1210      return "Message out of range\n";
    12121211   }
    12131212
Note: See TracChangeset for help on using the changeset viewer.