This is the mail archive of the
mailing list for the Cygwin project.
On Wed, 15 Jun 2011, Tod wrote:
I'm passing a 128 byte char array. I allocated it to provide enough room for
the date/time stamp this function is returning. strlen(tout) will resolve to
the length of the tout string.
You said above that I shouldn't be using strlen(tout) and instead I should be
passing 128. Would I be better off using sizeof(tout) instead?
Also, the code has always worked. I just recompiled it recently. Now the
date works but the time isn't appearing. What could be causing that?
tout is a char *, so sizeof(tout) in getTime() will be 4 or 8. You will
need to change the calling sequence of getTime() to pass the length of
tout, which will depend on how you allocated it:
char *tout = malloc(128);
Problem reports: http://cygwin.com/problems.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple