MCPcopy Create free account
hub / github.com/CloverHackyColor/CloverBootloader / newStringForKey

Function newStringForKey

Trash/stringTable.c:236–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

234}
235
236char *
237newStringForKey(char *key)
238{
239 char *val, *newstr;
240 INTN size;
241
242 if (getValueForKey(key, &val, &size) && size) {
243 newstr = malloc(size + 1);
244 strncpy(newstr, val, size);
245 return newstr;
246 } else {
247 return 0;
248 }
249}
250
251/* parse a command line
252 * in the form: [<argument> ...] [<option>=<value> ...]

Callers

nothing calls this directly

Calls 3

getValueForKeyFunction · 0.85
mallocFunction · 0.50
strncpyFunction · 0.50

Tested by

no test coverage detected