while (chptr > contents && isspace(*chptr)) chptr--;
while (chptr >= contents && isspace(*chptr)) chptr--;
int userCtl(char * file) {    char * contents;    char * chptr;    char * end;    int fd;    int size;    size = testSafe(file);    contents = alloca(size + 2);    if ((fd = open(file, O_RDONLY)) < 0) {	fprintf(stderr, "failed to open %s: %s\n", file, strerror(errno));	exit(1);    }    if (read(fd, contents, size) != size) {	perror("error reading device configuration");	exit(1);    }    close(fd);    contents[size] = '\n';    contents[size + 1] = '\0';    /* each pass parses a single line (until an answer is found), contents       itself points to the beginning of the current line */    while (*contents) {	chptr = contents;	while (*chptr != '\n') chptr++;	end = chptr + 1;	while (chptr > contents && isspace(*chptr)) chptr--;	*(++chptr) = '\0';	if (!strncmp(contents, "USERCTL=", 8)) {	    if (!strcmp(contents+8, "yes")) return FOUND_TRUE;	    else return FOUND_FALSE;	}	contents = end;    }    return NOT_FOUND;}