pem.c: fix copy and paste mistake from 55d030089b
This commit is contained in:
@@ -43,22 +43,26 @@ readline(char *line, int line_size, FILE * fp)
|
|||||||
{
|
{
|
||||||
size_t len;
|
size_t len;
|
||||||
|
|
||||||
if (!*line) {
|
if (!line) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
if (!fgets(line, line_size, fp)) {
|
if (!fgets(line, line_size, fp)) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (*line) {
|
||||||
len = strlen(line);
|
len = strlen(line);
|
||||||
if (len > 0 && line[len - 1] == '\n') {
|
if (len > 0 && line[len - 1] == '\n') {
|
||||||
line[len - 1] = '\0';
|
line[len - 1] = '\0';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (*line) {
|
||||||
len = strlen(line);
|
len = strlen(line);
|
||||||
if (len > 0 && line[len - 1] == '\r') {
|
if (len > 0 && line[len - 1] == '\r') {
|
||||||
line[len - 1] = '\0';
|
line[len - 1] = '\0';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user