more strcspn

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@11513 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
2002-10-21 15:42:06 +00:00
parent 5ee773037f
commit 27cc22110f

View File

@@ -82,8 +82,7 @@ get_cell_and_realm (krb5_context context,
krb5_set_error_string (context, "no cell in %s", AFS_SERVERTHISCELL);
return EINVAL;
}
if (buf[strlen(buf) - 1] == '\n')
buf[strlen(buf) - 1] = '\0';
buf[strcspn(buf, "\n")] = '\0';
fclose(f);
d->cell = strdup (buf);
@@ -100,8 +99,7 @@ get_cell_and_realm (krb5_context context,
AFS_SERVERMAGICKRBCONF);
return EINVAL;
}
if (buf[strlen(buf)-1] == '\n')
buf[strlen(buf)-1] = '\0';
buf[strcspn(buf, "\n")] = '\0';
fclose(f);
}
/* uppercase */