Index: [thread] [date] [subject] [author]
  From: Luke Palmer <lop@duke.edu>
  To  : 
  Date: Tue, 16 Feb 1999 23:15:28 -0500

bug in Astrachan code

there's a small bug in the astrachan code that will throw an exception
(Abort) if your user doesn't follow directions well.  :)   In this 'if'
statement in the reader classes, if a user enters a filename that is shorter
than ourSuffix, substr gets a negative number and is not very happy.

    if (filename.substr(filename.length()-ourSuffix.length(),
       ourSuffix.length()) == ourSuffix)

the fix is pretty easy:

if (ourSuffix.length() < filename.length())
    if (filename.substr(filename.length()-ourSuffix.length(),
       ourSuffix.length()) == ourSuffix)

....or something to that effect.  you probably have a test in main or
something to see if the return from ->makeReader() is NULL or not, which it
will be if an appropriate reader is not found.

good luck.
-luke




Index: [thread] [date] [subject] [author]