mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-06-27 14:58:30 +00:00
Add minor improvements and cleanup
This commit is contained in:
parent
9e3e985ae5
commit
feed0d2b0e
163 changed files with 2286 additions and 2245 deletions
|
@ -19,11 +19,14 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/str/str.h"
|
||||
|
||||
const char *indexdoublenulstring(const char *p, unsigned i) {
|
||||
const char *IndexDoubleNulString(const char *s, unsigned i) {
|
||||
size_t n;
|
||||
while (i--) {
|
||||
const char *p2 = rawmemchr(p, '\0');
|
||||
if (p2 == p) return NULL;
|
||||
p = p2 + 1;
|
||||
if ((n = strlen(s))) {
|
||||
s += n + 1;
|
||||
} else {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
return p;
|
||||
return s;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue