Hello Aurelien, Hello Klaus,

This is the example in "man strptime":

       #define _XOPEN_SOURCE
       #include <stdio.h>
       #include <stdlib.h>
       #include <time.h>

       int
       main(void)
       {
           struct tm tm;
           char buf[255];

           strptime("2001-11-12 18:31:01", "%Y-%m-%d %H:%M:%S", &tm);
           strftime(buf, sizeof(buf), "%d %b %Y %H:%M", &tm);
           puts(buf);
           exit(EXIT_SUCCESS);
       }

As we can see, there's no "memset" initializing the entire tm structure.
It would be nice to have a "memset" added in this example, to illustrate
the text "that tm should be initialized before the call".

Regards,

Bart Martens





-- 
To UNSUBSCRIBE, email to debian-glibc-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org
Archive: http://lists.debian.org/1267452832.3684.28.ca...@tatty.hg67.intranet

Reply via email to