All pastes #1573218 Raw Edit

Untitled

public text v1 · immutable
#1573218 ·published 2009-09-20 20:04 UTC
rendered paste body
char *date() {
    time_t rawtime;
    struct tm * timeinfo;
    char   buffer [128];

    time( &rawtime );
    timeinfo = localtime( &rawtime );
    strftime(buffer, 128, "%a %b %d %X %Z %Y", timeinfo);

    // Now here is the warning (and error)
    puts( buffer ); // Sun Sep 20 21:56:21 CEST 2009
@@    return buffer;  // Some garbled stuff :(
}

// This is the output:
// 00000000  f0 d0 98 bf 01 00 00 00  1d 00 00 00 e0 74 e3 b7  |.............t..|
// 00000010  f0 d0 98 bf f4 5f f5 b7  58 d1 98 bf 6a 0a        |....._..X...j.|