kuro/util.c

20 lines
331 B
C
Raw Normal View History

2024-01-22 07:50:23 +00:00
#include "dat.h"
#include "fns.h"
int strequ(char* s1, char* s2) {
return strcmp(s1, s2) == 0;
}
char* strcsw(char* s, char a, char b) {
int i = 0;
char c;
while ((c = s[i])) {
s[i++] = c == a ? b : c;
}
return s;
}
char* uvlong_to_hex(uvlong input, char* buf) {
sprintf(buf, "%08%x\0", input);
return buf;
}