Changeset View
Changeset View
Standalone View
Standalone View
stand/efi/libefi/efichar.c
Show First 20 Lines • Show All 196 Lines • ▼ Show 20 Lines | utf8_to_ucs2(const char *name, efi_char **nmp, size_t *len) | ||||
return (0); | return (0); | ||||
ilseq: | ilseq: | ||||
if (freeit) { | if (freeit) { | ||||
free(nm); | free(nm); | ||||
*nmp = NULL; | *nmp = NULL; | ||||
} | } | ||||
return (EILSEQ); | return (EILSEQ); | ||||
} | } | ||||
int | |||||
is_ascii(uint8_t *data, size_t datasz) | |||||
{ | |||||
UINTN i; | |||||
for (i = 0; i < datasz; i++) { | |||||
/* | |||||
* Quick hack to see if this ascii-ish string is printable | |||||
* range plus tab, cr and lf. | |||||
*/ | |||||
if ((data[i] < 32 || data[i] > 126) | |||||
&& data[i] != 9 && data[i] != 10 && data[i] != 13) | |||||
return (0); | |||||
} | |||||
return (1); | |||||
} |