diff options
author | Jan200101 <sentrycraft123@gmail.com> | 2020-12-16 16:35:10 +0100 |
---|---|---|
committer | Jan200101 <sentrycraft123@gmail.com> | 2020-12-16 16:35:10 +0100 |
commit | 1ca0317a351f3075b2ea0b9bb5e59ccb4bcb960b (patch) | |
tree | 4555aeb903071e2a12f66eff46fea403b716257d /src/common.c | |
parent | 7cfe6b1e6132e608fcc034bf97611e4b1eb57613 (diff) | |
download | polecat-1ca0317a351f3075b2ea0b9bb5e59ccb4bcb960b.tar.gz polecat-1ca0317a351f3075b2ea0b9bb5e59ccb4bcb960b.zip |
add more warning flags, correct syntax, add UNUSED macro, […]
- added -Wall -Wextra -pedantic to the compile options
- various syntax has been corrected:
- static is used before const
- correct integer types are used in for loops
- empty newlines are added
- every command has an argc and argv but some don't use them so they are marked as potentially unused if compiled on a GNUC compatible compiler
- mark JSONC variables as advanced so they do not show up as generic variables
Diffstat (limited to 'src/common.c')
-rw-r--r-- | src/common.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common.c b/src/common.c index 7f91105..17edbd9 100644 --- a/src/common.c +++ b/src/common.c @@ -58,7 +58,7 @@ int makeDir(const char* path) char pathcpy[PATH_MAX]; char *index; - strncpy(pathcpy, path, PATH_MAX); // make a mutable copy of the path + strncpy(pathcpy, path, PATH_MAX-1); // make a mutable copy of the path for(index = pathcpy+1; *index; ++index) { @@ -126,4 +126,4 @@ int removeDir(const char *path) { r = rmdir(path); return r; -}
\ No newline at end of file +} |