]> ruderich.org/simon Gitweb - coloredstderr/coloredstderr.git/commitdiff
Add missing const and document where it can't be used.
authorSimon Ruderich <simon@ruderich.org>
Thu, 13 Jun 2013 20:13:16 +0000 (22:13 +0200)
committerSimon Ruderich <simon@ruderich.org>
Thu, 13 Jun 2013 20:13:16 +0000 (22:13 +0200)
src/coloredstderr.c
src/debug.h

index 0d76b5aee7dd0799c40e1ccf82b313e3f4002221..3fe2053ce251bb33fc06dd9b59397212466a75c6 100644 (file)
@@ -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); \
index 5e5cc6d937ef55e7e73de1f62310183daa40bb8a..911a440fb0f83feb30c039351cd2216a81958c28 100644 (file)
@@ -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);