projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
check return value of m_getfld2 befor using the field
[mmh]
/
sbr
/
m_getfld2.c
diff --git
a/sbr/m_getfld2.c
b/sbr/m_getfld2.c
index
cd1c6be
..
45172aa
100644
(file)
--- a/
sbr/m_getfld2.c
+++ b/
sbr/m_getfld2.c
@@
-10,7
+10,6
@@
#include <h/utils.h>
#include <stdio.h>
#include <ctype.h>
#include <h/utils.h>
#include <stdio.h>
#include <ctype.h>
-#include <stdbool.h>
enum threestate {
enum threestate {
@@
-24,7
+23,7
@@
enum threestate {
*/
static enum threestate is_falted(FILE *);
static size_t copyname(char *, char *);
*/
static enum threestate is_falted(FILE *);
static size_t copyname(char *, char *);
-static bool is_separator(char *);
+static boolean is_separator(char *);
/*
/*
@@
-204,7
+203,7
@@
copyname(char *dst, char *src)
}
len = sep - src;
}
len = sep - src;
- if (len >= NAMESZ) {
+ if (len >= NAMESZ - 1) {
return 0;
}
return 0;
}
@@
-214,7
+213,7
@@
copyname(char *dst, char *src)
return strlen(dst);
}
return strlen(dst);
}
-static bool
+static boolean
is_separator(char *line)
{
/*
is_separator(char *line)
{
/*
@@
-225,7
+224,7
@@
is_separator(char *line)
line++;
}
if (strcmp("\n", line) == 0 || strcmp("\r\n", line) == 0 ) {
line++;
}
if (strcmp("\n", line) == 0 || strcmp("\r\n", line) == 0 ) {
- return true;
+ return TRUE;
}
}
- return false;
+ return FALSE;
}
}