Skip to content

Commit df8e313

Browse files
pcloudsgitster
authored andcommitted
compat/win32/syslog.c: use warning_errno()
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 4b94ec9 commit df8e313

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compat/win32/syslog.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@ void syslog(int priority, const char *fmt, ...)
2828
va_end(ap);
2929

3030
if (str_len < 0) {
31-
warning("vsnprintf failed: '%s'", strerror(errno));
31+
warning_errno("vsnprintf failed");
3232
return;
3333
}
3434

3535
str = malloc(st_add(str_len, 1));
3636
if (!str) {
37-
warning("malloc failed: '%s'", strerror(errno));
37+
warning_errno("malloc failed");
3838
return;
3939
}
4040

@@ -45,7 +45,7 @@ void syslog(int priority, const char *fmt, ...)
4545
while ((pos = strstr(str, "%1")) != NULL) {
4646
str = realloc(str, st_add(++str_len, 1));
4747
if (!str) {
48-
warning("realloc failed: '%s'", strerror(errno));
48+
warning_errno("realloc failed");
4949
return;
5050
}
5151
memmove(pos + 2, pos + 1, strlen(pos));

0 commit comments

Comments
 (0)