This is the mail archive of the libc-help@sourceware.org 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]
Other format: [Raw text]

Re: strftime segfault vs return error code


afaict, POSIX really only has this to say on the matter:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/strftime.html

Both C and POSIX have the same text. In C, the text is in section
7.27.3.5 The strftime function, paragraph 3:

  The appropriate characters are determined using the LC_TIME
  category of the current locale and by the values of zero or
  more members of the broken-down time structure pointed to by
  timeptr, as specified in brackets in the description. If any
  of the specified values are outside the normal range, the
  characters stored are unspecified.

This implies that the function is required to produce a valid
NUL-terminated string on output (assuming the output fits into
the provided buffer) and return the number of characters it
stored.

Martin


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