diff options
-rw-r--r-- | src/lfs.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -738,7 +738,7 @@ static void push_st_blksize (lua_State *L, STAT_STRUCT *info) { | |||
738 | 738 | ||
739 | #ifdef _WIN32 | 739 | #ifdef _WIN32 |
740 | static const char *perm2string (unsigned short mode) { | 740 | static const char *perm2string (unsigned short mode) { |
741 | static char perms[10] = "---------"; //removed explicit \0 (it would be the second, since "" adds one already and perms[10] is only 10 big. | 741 | static char perms[10] = "---------"; |
742 | int i; | 742 | int i; |
743 | for (i=0;i<9;i++) perms[i]='-'; | 743 | for (i=0;i<9;i++) perms[i]='-'; |
744 | if (mode & _S_IREAD) | 744 | if (mode & _S_IREAD) |
@@ -751,7 +751,7 @@ static const char *perm2string (unsigned short mode) { | |||
751 | } | 751 | } |
752 | #else | 752 | #else |
753 | static const char *perm2string (mode_t mode) { | 753 | static const char *perm2string (mode_t mode) { |
754 | static char perms[10] = "---------\0"; | 754 | static char perms[10] = "---------"; |
755 | int i; | 755 | int i; |
756 | for (i=0;i<9;i++) perms[i]='-'; | 756 | for (i=0;i<9;i++) perms[i]='-'; |
757 | if (mode & S_IRUSR) perms[0] = 'r'; | 757 | if (mode & S_IRUSR) perms[0] = 'r'; |