| 90 | |
| 91 | |
| 92 | static int str_upper (lua_State *L) { |
| 93 | size_t l; |
| 94 | size_t i; |
| 95 | luaL_Buffer b; |
| 96 | const char *s = luaL_checklstring(L, 1, &l); |
| 97 | char *p = luaL_buffinitsize(L, &b, l); |
| 98 | for (i=0; i<l; i++) |
| 99 | p[i] = toupper(uchar(s[i])); |
| 100 | luaL_pushresultsize(&b, l); |
| 101 | return 1; |
| 102 | } |
| 103 | |
| 104 | |
| 105 | /* reasonable limit to avoid arithmetic overflow */ |
nothing calls this directly
no test coverage detected