Sfoglia il codice sorgente

datetime: Add error message

Aaron Marcher 7 anni fa
parent
commit
932f65c373
1 ha cambiato i file con 1 aggiunte e 0 eliminazioni
  1. 1 0
      components/datetime.c

+ 1 - 0
components/datetime.c

@@ -10,6 +10,7 @@ datetime(const char *fmt)
 
 	t = time(NULL);
 	if (!strftime(buf, sizeof(buf), fmt, localtime(&t))) {
+		fprintf(stderr, "strftime: Result string exceeds buffer size\n");
 		return NULL;
 	}