size_t count;
if (file_map(filename, &buf, &bufsize) != 0) {
- err("unable to read db file '%s'", filename);
+ dbg("no db file to read '%s'", filename);
return -1;
}
nodename[count-2] = '\0';
dbg("compare '%s' '%s'", nodename, name);
if (strcmp(nodename, name) == 0) {
- memcpy(devpath, &bufline[2], count-2);
+ strlcpy(devpath, nodename, len);
devpath[count-2] = '\0';
file_unmap(buf, bufsize);
closedir(dir);