]> git.ipfire.org Git - thirdparty/libbsd.git/commitdiff
Make setprogname and getprogname arguments and return value const
authorGuillem Jover <guillem@hadrons.org>
Thu, 21 Jan 2010 13:34:55 +0000 (14:34 +0100)
committerGuillem Jover <guillem@hadrons.org>
Thu, 21 Jan 2010 13:34:55 +0000 (14:34 +0100)
This is more correct as the strings are not going to be changed, and it
matches the function signatures on other BSDs.

Suggested-by: Aurelien Jarno <aurel32@debian.org>
include/bsd/stdlib.h
src/progname.c

index cec5a281c21f5795d813bbfeac5a5f7aa6e8c52d..6e7a88cf0169c412cef95e9be2f3bc036aacb9af 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Copyright © 2005 Aurelien Jarno
  * Copyright © 2006 Robert Millan
- * Copyright © 2008, 2009 Guillem Jover
+ * Copyright © 2008, 2009, 2010 Guillem Jover
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -48,8 +48,8 @@ void arc4random_addrandom(u_char *dat, int datlen);
 
 int dehumanize_number(const char *str, int64_t *size);
 
-char *getprogname ();
-void setprogname (char *);
+const char *getprogname(void);
+void setprogname(const char *);
 
 int heapsort (void *, size_t, size_t, int (*)(const void *, const void *));
 
index 0a47c22a29d82e8b63cd4c74c2d7643cad646159..a5675c01e913c051e75348a223cf88108f56f0ab 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright © 2006 Robert Millan
+ * Copyright © 2010 Guillem Jover
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
 
 #include <bsd/stdlib.h>
 
-static char *__progname = NULL;
+static const char *__progname = NULL;
 
-char *
-getprogname()
+const char *
+getprogname(void)
 {
        return __progname;
 }
 
 void
-setprogname(char *new)
+setprogname(const char *new)
 {
        __progname = new;
 }