cmd: add /status.json to describe what and how it works

This commit is contained in:
Kamil Trzcinski
2022-09-03 12:14:01 +02:00
parent aafd120af3
commit b2dfba5577
12 changed files with 195 additions and 12 deletions

View File

@ -2,6 +2,7 @@
#include "util/opts/opts.h"
#include <string.h>
#include <ctype.h>
char *
strstrn(const char *s, const char *find, size_t len)
@ -101,3 +102,17 @@ int ioctl_retried(const char *name, int fd, int request, void *arg)
}
return ret;
}
char *trim(char *s)
{
// skip left side white spaces
while (isspace (*s))
s++;
// skip right side white spaces
char *e = s + strlen(s) - 1;
while (e >= s && isspace(*e))
*e-- = 0;
return s;
}