comparison util.c @ 1783:eda8df5bc74c

Minor cleanup
author Michael Pavone <pavone@retrodev.com>
date Mon, 11 Mar 2019 00:04:48 -0700
parents ba3fb7a3be6b
children 52a47611a273
comparison
equal deleted inserted replaced
1782:b2bffd98063d 1783:eda8df5bc74c
185 if (!*text) { 185 if (!*text) {
186 return text; 186 return text;
187 } 187 }
188 *text = 0; 188 *text = 0;
189 return text+1; 189 return text+1;
190 }
191
192 uint8_t startswith(const char *haystack, const char *prefix)
193 {
194 return !strncmp(haystack, prefix, strlen(prefix));
190 } 195 }
191 196
192 void bin_to_hex(uint8_t *output, uint8_t *input, uint64_t size) 197 void bin_to_hex(uint8_t *output, uint8_t *input, uint64_t size)
193 { 198 {
194 while (size) 199 while (size)