]> git.proxmox.com Git - mirror_lxc.git/commitdiff
remove needless check for 'line' which cannot be NULl there
authorSerge Hallyn <serge.hallyn@ubuntu.com>
Mon, 22 Apr 2013 20:46:26 +0000 (15:46 -0500)
committerSerge Hallyn <serge.hallyn@ubuntu.com>
Mon, 22 Apr 2013 20:46:26 +0000 (15:46 -0500)
(found by coverity)

Signed-off-by: Serge Hallyn <serge.hallyn@ubuntu.com>
src/lxc/attach.c

index 5b3ee4fc1aa7c1026b9d31bcc0a98e1786fbf6e1..a7e90747526dac29a592f3eb1dfce4525705eb77 100644 (file)
@@ -358,7 +358,7 @@ char *lxc_attach_getpwshell(uid_t uid)
                                continue;
 
                        /* trim line on the right hand side */
-                       for (i = strlen(line); line && i > 0 && (line[i - 1] == '\n' || line[i - 1] == '\r'); --i)
+                       for (i = strlen(line); i > 0 && (line[i - 1] == '\n' || line[i - 1] == '\r'); --i)
                                line[i - 1] = '\0';
 
                        /* split into tokens: first user name */