projects
/
mmh
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* patch #3966: Create a mh_xmalloc function to prevent mistakes when
[mmh]
/
sbr
/
vfgets.c
diff --git
a/sbr/vfgets.c
b/sbr/vfgets.c
index
39cfaa2
..
beb0afd
100644
(file)
--- a/
sbr/vfgets.c
+++ b/
sbr/vfgets.c
@@
-10,6
+10,7
@@
*/
#include <h/mh.h>
*/
#include <h/mh.h>
+#include <h/utils.h>
#define QUOTE '\\'
#define QUOTE '\\'
@@
-23,8
+24,7
@@
vfgets (FILE *in, char **bp)
static char *pp = NULL;
if (pp == NULL)
static char *pp = NULL;
if (pp == NULL)
- if (!(pp = malloc ((size_t) (len = BUFSIZ))))
- adios (NULL, "unable to allocate string storage");
+ pp = mh_xmalloc ((size_t) (len = BUFSIZ));
for (ep = (cp = pp) + len - 1;;) {
if (fgets (cp, ep - cp + 1, in) == NULL) {
for (ep = (cp = pp) + len - 1;;) {
if (fgets (cp, ep - cp + 1, in) == NULL) {