diff options
-rw-r--r-- | lstrlib.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | ** $Id: lstrlib.c,v 1.137 2007/10/25 19:30:36 roberto Exp roberto $ | 2 | ** $Id: lstrlib.c,v 1.138 2007/10/29 15:51:10 roberto Exp roberto $ |
3 | ** Standard library for string operations and pattern-matching | 3 | ** Standard library for string operations and pattern-matching |
4 | ** See Copyright Notice in lua.h | 4 | ** See Copyright Notice in lua.h |
5 | */ | 5 | */ |
@@ -732,7 +732,7 @@ static const char *scanformat (lua_State *L, const char *strfrmt, char *form) { | |||
732 | if (isdigit(uchar(*p))) | 732 | if (isdigit(uchar(*p))) |
733 | luaL_error(L, "invalid format (width or precision too long)"); | 733 | luaL_error(L, "invalid format (width or precision too long)"); |
734 | *(form++) = '%'; | 734 | *(form++) = '%'; |
735 | strncpy(form, strfrmt, p - strfrmt + 1); | 735 | memcpy(form, strfrmt, p - strfrmt + 1); |
736 | form += p - strfrmt + 1; | 736 | form += p - strfrmt + 1; |
737 | *form = '\0'; | 737 | *form = '\0'; |
738 | return p; | 738 | return p; |