aboutsummaryrefslogtreecommitdiff
path: root/pathtrace.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2012-01-20 11:56:00 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2012-01-20 11:56:00 +0100
commit6cecba53225ae30f1a28ce6954fb0cda847f3688 (patch)
tree3ddf331b542e8645751e6de0c1bb5246a044b046 /pathtrace.c
parenta17e55ca8f6f3d9897d891215405715b1bee5131 (diff)
downloadstrace-6cecba53225ae30f1a28ce6954fb0cda847f3688.tar.gz
Change umovestr API: return > 0 instead of 0 if NUL was seen
* pathtrace.c (upathmatch): Adjust umovestr return value check for new API. * util.c (printpathn): Use umovestr() > 0 return value for more efficient (and robust - we don't depend on "no overwrote past NUL" behavior anymore) handling of terminating NUL. (printstr): Remove useless NUL placement before umovestr() call. Allocate 1 byte more to outstr[] array - for NUL. (umovestr): Change to return 1 if NUL was seen. Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'pathtrace.c')
-rw-r--r--pathtrace.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pathtrace.c b/pathtrace.c
index 697dfeb6..d7ba87cc 100644
--- a/pathtrace.c
+++ b/pathtrace.c
@@ -68,7 +68,7 @@ upathmatch(struct tcb *tcp, unsigned long upath)
{
char path[PATH_MAX + 1];
- return umovestr(tcp, upath, sizeof path, path) == 0 &&
+ return umovestr(tcp, upath, sizeof path, path) >= 0 &&
pathmatch(path);
}