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,11 +370,8 @@ gettoproot(struct afscp_cell *cell, char *p, char **q,
r = p;
while (*r && *r != '/')
r++;
if (!*r && !*p) {
afscp_errno = ENODEV;
return 1;
}
*r++ = 0;
if (*r)
*r++ = 0;
*q = r;
afs_dprintf(("gettoproot: dynroot looking up cell %s\n", p));
cell = afscp_CellByName(p, NULL);