Skip to content

Commit e7f566e

Browse files
0-wiz-0jiegec
authored andcommitted
[PATCH] lsof: fix pointer/value confusion
Now writes the full file path names in the NAME column again.
1 parent 4eaee31 commit e7f566e

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

lib/rnmt.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,20 +169,21 @@ void ncache_load(struct lsof_context *ctx) {
169169
ncache_walk(ctx, (KA_T)vi.vi_nc_tree.rbt_root, 0);
170170
}
171171

172+
#include <assert.h>
172173
static void build_path(char **buf, size_t *remaining, const struct lnc *lnc) {
173174
size_t len;
174175

175176
if (lnc == NULL)
176177
return;
177178

178179
build_path(buf, remaining, lnc->lnc_plnc);
179-
if (remaining == 0) {
180+
if (*remaining == 0) {
180181
return;
181182
}
182183
if (lnc->lnc_plnc != NULL) {
183184
**buf = '/';
184185
(*buf)++;
185-
remaining--;
186+
(*remaining)--;
186187
}
187188
len = lnc->lnc_nlen;
188189
if (*remaining < len)

0 commit comments

Comments
 (0)