(get_cell_and_realm): only remove the newline if it's there

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6962 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1999-09-14 15:42:45 +00:00
parent 20ca7ec642
commit d66db0b648

View File

@@ -80,7 +80,8 @@ get_cell_and_realm (struct akf_data *d)
fclose (f);
return EINVAL;
}
buf[strlen(buf)-1] = '\0';
if (buf[strlen(buf) - 1] == '\n')
buf[strlen(buf)-1] = '\0';
fclose(f);
d->cell = strdup (buf);
@@ -93,11 +94,12 @@ get_cell_and_realm (struct akf_data *d)
fclose (f);
return EINVAL;
}
buf[strlen(buf)-1] = '\0';
if (buf[strlen(buf)-1] == '\n')
buf[strlen(buf)-1] = '\0';
fclose(f);
}
/* uppercase */
for (cp = buf; *cp != 0; cp++)
for (cp = buf; *cp != '\0'; cp++)
*cp = toupper(*cp);
d->realm = strdup (buf);