Unified · Split
| @@ -33,7 +33,9 @@ fmttime(long long v) · 32 unmodified lines | ||
| 33 | 33 | static char buf[32]; |
| 34 | 34 | time_t t = v; |
| 35 | 35 | struct tm *tm; |
| 36 | − tm = gmtime(&t); | |
| 37 | − strftime(buf, sizeof(buf), "%c", tm); | |
| 36 | + | |
| 37 | + buf[0] = 0; | |
| 38 | + if((tm = gmtime(&t)) != nil) | |
| 39 | + strftime(buf, sizeof(buf), "%c", tm); | |
| 38 | 40 | return buf; |
| 39 | 41 | } |