Add minor improvements and cleanup

This commit is contained in:
Justine Tunney 2020-10-27 03:39:46 -07:00
parent 9e3e985ae5
commit feed0d2b0e
163 changed files with 2286 additions and 2245 deletions

View file

@ -20,11 +20,11 @@
#include "libc/str/str.h"
int getkvlin(const char *name, const char *const unsorted[]) {
unsigned i, n;
if (unsorted) {
unsigned namelen = strlen(name);
for (int i = 0; unsorted[i]; ++i) {
if (strncmp(unsorted[i], name, namelen) == 0 &&
unsorted[i][namelen] == '=') {
n = strlen(name);
for (i = 0; unsorted[i]; ++i) {
if (strncmp(unsorted[i], name, n) == 0 && unsorted[i][n] == '=') {
return i;
}
}