diff options
author | 2014-06-13 13:37:05 -0500 | |
---|---|---|
committer | 2014-06-13 13:37:05 -0500 | |
commit | de1ca4c80976f64bff3d317e2082a6782b4c54ab (patch) | |
tree | a01d3222804bd47273075e747ccf6295fe8dada1 | |
parent | d2198c6537031dd1d75f9bcdf601f67a370b75b5 (diff) | |
download | pseudo-de1ca4c80976f64bff3d317e2082a6782b4c54ab.tar.gz pseudo-de1ca4c80976f64bff3d317e2082a6782b4c54ab.tar.bz2 pseudo-de1ca4c80976f64bff3d317e2082a6782b4c54ab.zip |
Use constant initializer for static
strlen(array) isn't a constant expression, even though gcc can sometimes
figure it out at compile time.
-rw-r--r-- | ChangeLog.txt | 1 | ||||
-rw-r--r-- | pseudo_util.c | 2 |
2 files changed, 2 insertions, 1 deletions
diff --git a/ChangeLog.txt b/ChangeLog.txt index d61a4ed..4d7a003 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,5 +1,6 @@ 2014-06-13: * (seebs) don't follow symlinks for lutimes. + * (seebs) Use sizeof instead of strlen to initialize static value. 2014-05-27: * (seebs) start noticing umask, mask it out from open or mkdir diff --git a/pseudo_util.c b/pseudo_util.c index 325cabf..e4e1fc8 100644 --- a/pseudo_util.c +++ b/pseudo_util.c @@ -98,7 +98,7 @@ dump_env(char **envp) { int pseudo_has_unload(char * const *envp) { static const char unload[] = "PSEUDO_UNLOAD"; - static size_t unload_len = strlen(unload); + static size_t unload_len = sizeof(unload) - 1; size_t i = 0; /* Is it in the caller environment? */ |