From b6850a9e3cd988829e5d09918928ef5aa9b4e731 Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Mon, 26 Jan 2009 23:24:07 +0100 Subject: Check inev->len before printing name --- inotify-watch.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'inotify-watch.c') diff --git a/inotify-watch.c b/inotify-watch.c index ccedf2f..1a32786 100644 --- a/inotify-watch.c +++ b/inotify-watch.c @@ -3,7 +3,7 @@ * * Watch a file or directory for changes using inotify * - * Copyright (c) Tobias Klauser + * Copyright (c) 2008-2009 Tobias Klauser * * All rights reserved. */ @@ -21,7 +21,7 @@ struct mask2string { const char *desc; }; -static struct mask2string events[] = { +static const struct mask2string events[] = { { IN_ACCESS, "ACCESS" }, { IN_MODIFY, "MODIFY" }, { IN_ATTRIB, "ATTRIB" }, @@ -53,7 +53,8 @@ static void inotify_print_event(struct inotify_event *inev) /* stat? */ printf("(%s) wd=%04x, cookie=%04x, len=%04x, name=\"%s\" :", inev->mask & IN_ISDIR ? "dir" : "file", - inev->wd, inev->cookie, inev->len, inev->name); + inev->wd, inev->cookie, inev->len, + inev->len > 0 ? inev->name : ""); for (i = 0; events[i].desc; i++) if (inev->mask & events[i].mask) -- cgit v1.2.3-54-g00ecf acket-rx-pump-back'>packet-rx-pump-back net-next plumbingsTobias Klauser
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2016-05-31 08:54:52 +0200
committerGerd Hoffmann <kraxel@redhat.com>2016-06-07 10:37:06 +0200
commitdd5465910740ad74a318cf7464dad1136a2e0ca9 (patch)
tree1c419b41f7021e73b58ca6014092876f702b2bcf
parentbbbed8884f8e623fb65846f6ec931fef79c30051 (diff)
add cursor hotspot to drm_framebuffer
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>