more strcspn
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11513 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -82,8 +82,7 @@ get_cell_and_realm (krb5_context context,
|
|||||||
krb5_set_error_string (context, "no cell in %s", AFS_SERVERTHISCELL);
|
krb5_set_error_string (context, "no cell in %s", AFS_SERVERTHISCELL);
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
}
|
}
|
||||||
if (buf[strlen(buf) - 1] == '\n')
|
buf[strcspn(buf, "\n")] = '\0';
|
||||||
buf[strlen(buf) - 1] = '\0';
|
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
|
||||||
d->cell = strdup (buf);
|
d->cell = strdup (buf);
|
||||||
@@ -100,8 +99,7 @@ get_cell_and_realm (krb5_context context,
|
|||||||
AFS_SERVERMAGICKRBCONF);
|
AFS_SERVERMAGICKRBCONF);
|
||||||
return EINVAL;
|
return EINVAL;
|
||||||
}
|
}
|
||||||
if (buf[strlen(buf)-1] == '\n')
|
buf[strcspn(buf, "\n")] = '\0';
|
||||||
buf[strlen(buf)-1] = '\0';
|
|
||||||
fclose(f);
|
fclose(f);
|
||||||
}
|
}
|
||||||
/* uppercase */
|
/* uppercase */
|
||||||
|
Reference in New Issue
Block a user