From 0a82aae451c5c95ceacb5fcb235f4d1ea964f5f5 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Thu, 15 Jan 2015 16:50:01 -0200 Subject: Cleanup use of explicit \0 --- src/lfs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/lfs.c b/src/lfs.c index e1da1aa..b84ca82 100644 --- a/src/lfs.c +++ b/src/lfs.c @@ -738,7 +738,7 @@ static void push_st_blksize (lua_State *L, STAT_STRUCT *info) { #ifdef _WIN32 static const char *perm2string (unsigned short mode) { - static char perms[10] = "---------"; //removed explicit \0 (it would be the second, since "" adds one already and perms[10] is only 10 big. + static char perms[10] = "---------"; int i; for (i=0;i<9;i++) perms[i]='-'; if (mode & _S_IREAD) @@ -751,7 +751,7 @@ static const char *perm2string (unsigned short mode) { } #else static const char *perm2string (mode_t mode) { - static char perms[10] = "---------\0"; + static char perms[10] = "---------"; int i; for (i=0;i<9;i++) perms[i]='-'; if (mode & S_IRUSR) perms[0] = 'r'; -- cgit v1.2.3-55-g6feb