diff options
| author | Hisham Muhammad <hisham@gobolinux.org> | 2015-01-15 16:50:01 -0200 |
|---|---|---|
| committer | Hisham Muhammad <hisham@gobolinux.org> | 2015-01-15 16:50:01 -0200 |
| commit | 0a82aae451c5c95ceacb5fcb235f4d1ea964f5f5 (patch) | |
| tree | 495fb47e36d388163fe5f1cd808341a220bb46d2 | |
| parent | a86072a7ecbe00922acf4a2ebdb856334fb3e6b9 (diff) | |
| download | luafilesystem-0a82aae451c5c95ceacb5fcb235f4d1ea964f5f5.tar.gz luafilesystem-0a82aae451c5c95ceacb5fcb235f4d1ea964f5f5.tar.bz2 luafilesystem-0a82aae451c5c95ceacb5fcb235f4d1ea964f5f5.zip | |
Cleanup use of explicit \0
| -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'; |
