Changeset 671c8f6 in git


Ignore:
Timestamp:
04/03/15 09:33:34 (5 years ago)
Author:
Olly Betts <olly@…>
Branches:
line_contents, master, stereo, travis-osx
Children:
66f5fc4
Parents:
48787a9
Message:

src/datain.c: Fix compile_error() and friends not to segfault if
passed a negative message number when no file is open.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r48787a9 r671c8f6  
     1Wed Mar 04 09:22:14 GMT 2015  Olly Betts <olly@survex.com>
     2
     3        * src/datain.c: Fix compile_error() and friends not to segfault if
     4          passed a negative message number when no file is open.
     5
    16Wed Mar 04 08:16:44 GMT 2015  Olly Betts <olly@survex.com>
    27
  • src/datain.c

    r48787a9 r671c8f6  
    130130   if (en < 0) {
    131131      en = -en;
    132       col = ftell(file.fh) - file.lpos;
     132      if (file.fh) col = ftell(file.fh) - file.lpos;
    133133   }
    134134   v_report(1, file.filename, file.line, col, en, ap);
     
    145145   if (en < 0) {
    146146      en = -en;
    147       col = ftell(file.fh) - file.lpos;
     147      if (file.fh) col = ftell(file.fh) - file.lpos;
    148148   }
    149149   v_report(1, file.filename, file.line, col, en, ap);
     
    193193   if (en < 0) {
    194194      en = -en;
    195       col = ftell(file.fh) - file.lpos;
     195      if (file.fh) col = ftell(file.fh) - file.lpos;
    196196   }
    197197   v_report(0, file.filename, file.line, col, en, ap);
Note: See TracChangeset for help on using the changeset viewer.