MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / u_posrelat

Function u_posrelat

lib/lua/src/lutf8lib.c:47–51  ·  view source on GitHub ↗

from strlib */ translate a relative string position: negative means back from end */

Source from the content-addressed store, hash-verified

45/* from strlib */
46/* translate a relative string position: negative means back from end */
47static lua_Integer u_posrelat (lua_Integer pos, size_t len) {
48 if (pos >= 0) return pos;
49 else if (0u - (size_t)pos > len) return 0;
50 else return (lua_Integer)len + pos + 1;
51}
52
53
54/*

Callers 3

utflenFunction · 0.85
codepointFunction · 0.85
byteoffsetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected