Explorar o código

datetime: Add error message

Aaron Marcher %!s(int64=7) %!d(string=hai) anos
pai
achega
932f65c373
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  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;
 	}