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: case DT_LNK:
lnkcnt++; lnkcnt++;
// char* linkname; // char* linkname;
char linkname[buf.st_size + 1]; // char linkname[buf.st_size + 1];
// linkname = malloc(buf.st_size + 1); // linkname = malloc(buf.st_size + 1);
ssize_t r; // ssize_t r;
r = readlink(statpath.c_str(), linkname, buf.st_size + 1); // r = readlink(statpath.c_str(), linkname, buf.st_size + 1);
linkname[buf.st_size] = '\0'; // linkname[buf.st_size] = '\0';
cout << "[l] "; cout << "[l] ";
cout << statpath << " points to " << linkname; // cout << statpath << " points to " << linkname;
break; break;
default: default:
cout << "[none] "; cout << "[no type] ";
break; break;
} }
ht[dp->d_ino] = true; ht[dp->d_ino] = true;