This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: strtok bug


   Date: Fri, 14 Jan 2000 08:19:30 +0100 (CET)
   From: Clifford Wolf <clifford@clifford.at>

   Sure - It's not defined in the standard what should happen for subsequent
   searches when allready the first call returned a NULL pointer. But it does
   not say 'Read and write from a NULL pointer and dump core'. It just says
   nothing about it - so the most logical thing would be to do the same thing
   as it's defined for the case that the last token has been reached and
   another search is invoked: returning a NULL pointer.

Whoa!  NEVER EVER assume things about undefined behaviour!  It is
probably best to think about undefined behaviour as: "If I do this, my
program will fault and dump core".

Mark

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]