This commit is contained in:
Ben Harris 2016-10-26 15:25:30 -04:00
parent c1e6dc2f7c
commit 88b3272939
1 changed files with 6 additions and 6 deletions

View File

@ -46,16 +46,16 @@ bool listFileAndType(const string &dir) {
case DT_LNK:
lnkcnt++;
// char* linkname;
char linkname[buf.st_size + 1];
// char linkname[buf.st_size + 1];
// linkname = malloc(buf.st_size + 1);
ssize_t r;
r = readlink(statpath.c_str(), linkname, buf.st_size + 1);
linkname[buf.st_size] = '\0';
// ssize_t r;
// r = readlink(statpath.c_str(), linkname, buf.st_size + 1);
// linkname[buf.st_size] = '\0';
cout << "[l] ";
cout << statpath << " points to " << linkname;
// cout << statpath << " points to " << linkname;
break;
default:
cout << "[none] ";
cout << "[no type] ";
break;
}
ht[dp->d_ino] = true;