afscp: null-terminate root.cell dir if needed in dynroot mode

instead of doing a check for something which will never be true,
and then terminating, just terminate if it's not already
null-terminated.

Change-Id: I8ad18800de22c8d10eb27fbcb2fffb2b3a5a9127
Reviewed-on: http://gerrit.openafs.org/9439
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Chaskiel Grundman <cg2v@andrew.cmu.edu>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
This commit is contained in:
Derrick Brashear 2013-03-07 06:53:16 -05:00
parent 2998ab4535
commit ceac74a6ba

View File

@ -370,10 +370,7 @@ gettoproot(struct afscp_cell *cell, char *p, char **q,
r = p; r = p;
while (*r && *r != '/') while (*r && *r != '/')
r++; r++;
if (!*r && !*p) { if (*r)
afscp_errno = ENODEV;
return 1;
}
*r++ = 0; *r++ = 0;
*q = r; *q = r;
afs_dprintf(("gettoproot: dynroot looking up cell %s\n", p)); afs_dprintf(("gettoproot: dynroot looking up cell %s\n", p));