MCPcopy Create free account
hub / github.com/F-Stack/f-stack / str_upper

Function str_upper

freebsd/contrib/openzfs/module/lua/lstrlib.c:102–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100
101
102static int str_upper (lua_State *L) {
103 size_t l;
104 size_t i;
105 luaL_Buffer b;
106 const char *s = luaL_checklstring(L, 1, &l);
107 char *p = luaL_buffinitsize(L, &b, l);
108 for (i=0; i<l; i++)
109 p[i] = toupper(uchar(s[i]));
110 luaL_pushresultsize(&b, l);
111 return 1;
112}
113
114
115/* reasonable limit to avoid arithmetic overflow */

Callers

nothing calls this directly

Calls 4

luaL_buffinitsizeFunction · 0.85
toupperFunction · 0.85
luaL_pushresultsizeFunction · 0.85
luaL_checklstringFunction · 0.70

Tested by

no test coverage detected