Add missing const and document where it can't be used.

This commit is contained in:
Simon Ruderich
2013-06-13 22:13:16 +02:00
parent 3c2b4bf9f6
commit 3d46e3ab9b
2 changed files with 3 additions and 3 deletions

View 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); \

View 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);