/* @l_filename: preallocated buffer receiving the normalized name @filename: filename to normalize Return: 0 on success, -1 on failure  */
static int normalize_longname(char *l_filename, const char *filename)
/* @l_filename: preallocated buffer receiving the normalized name @filename: filename to normalize Return: 0 on success, -1 on failure  */
static int normalize_longname(char *l_filename, const char *filename)
{
	const char *p, illegal[] = "<>:\"/\\|?*";
	if (strlen(filename) >= VFAT_MAXLEN_BYTES)
		return -1;
	for (p = filename; *p; ++p) {
		if ((unsigned char)*p < 0x20)
			return -1;
		if (strchr(illegal, *p))
			return -1;
	}
	strcpy(l_filename, filename);
	downcase(l_filename, VFAT_MAXLEN_BYTES);
	return 0;
}