Skip to content

Commit 52a003d

Browse files
author
Brian C. Thomas
committed
fixed bug in search_header()
1 parent 0b458ae commit 52a003d

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/file_read.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ char *parse_name(char *line)
1414
word = strtok(line, delims);
1515
/* check if the name begins with '>' or '@' and drop it */
1616
if ( *word == '>' || *word == '@' )
17-
word++; /* move the word up one char */
17+
word = word++; /* move the word up one char */
1818
return word;
1919
}
2020

src/search_header.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#include <stdio.h>
2-
/* #include <stdlib.h> */
32
#include <string.h>
43
#include <pcre.h>
54

@@ -11,6 +10,9 @@ int search_header(pcre *re, pcre_extra *re_extra, char *str) {
1110
int pcreExecRet;
1211
int pcre_ovector[MAX_CAPTURE_COUNT];
1312

13+
if (str == NULL) {
14+
return 0;
15+
}
1416

1517
pcreExecRet = pcre_exec(re, re_extra,
1618
str,

0 commit comments

Comments
 (0)