From: Simon Ruderich Date: Thu, 13 Jun 2013 20:13:16 +0000 (+0200) Subject: Add missing const and document where it can't be used. X-Git-Tag: 0.1~52 X-Git-Url: https://ruderich.org/simon/gitweb/?p=coloredstderr%2Fcoloredstderr.git;a=commitdiff_plain;h=3d46e3ab9b45d83f69e79a338a45f316e3f61dc0 Add missing const and document where it can't be used. --- diff --git a/src/coloredstderr.c b/src/coloredstderr.c index 0d76b5a..3fe2053 100644 --- a/src/coloredstderr.c +++ b/src/coloredstderr.c @@ -507,14 +507,14 @@ int execve(char const *filename, char * const argv[], char * const env[]) { /* Count arguments. */ \ size_t count = 1; /* arg */ \ va_start(ap, arg); \ - while (va_arg(ap, char const *)) { \ + while (va_arg(ap, char *)) { \ count++; \ } \ va_end(ap); \ \ /* Copy varargs. */ \ char *args[count + 1 /* terminating NULL */]; \ - args[0] = (char *)arg; \ + args[0] = (char *)arg; /* there's no other way around the cast */ \ \ size_t i = 1; \ va_start(ap, arg); \ diff --git a/src/debug.h b/src/debug.h index 5e5cc6d..911a440 100644 --- a/src/debug.h +++ b/src/debug.h @@ -36,7 +36,7 @@ static void debug_write(int fd, int first_call, char const *format, va_list ap) DLSYM_FUNCTION(real_close, "close"); if (first_call) { - char nl = '\n'; + char const nl = '\n'; real_write(fd, &nl, 1); } real_write(fd, buffer, (size_t)written);