[prev in list] [next in list] [prev in thread] [next in thread] 

List:       glibc-help
Subject:    strftime segfault vs return error code
From:       msebor () gmail ! com (Martin Sebor)
Date:       2015-09-20 2:43:00
Message-ID: 55FE1D5D.2050600 () gmail ! com
[Download RAW message or body]

> 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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic