diff options
author | Thomas Roessler <roessler@does-not-exist.org> | 1998-11-10 22:14:00 +0000 |
---|---|---|
committer | Thomas Roessler <roessler@does-not-exist.org> | 1998-11-10 22:14:00 +0000 |
commit | a3f726e35f1e7d918061074a85ebe7a2c7c300a5 (patch) | |
tree | d9ab2a281be2a13fbb1ec8682d4e5c7ff0502cde /edit.c | |
parent | 912c6b0df82fe3a2745d68131db9300222226a73 (diff) |
Introduce or rewrite mutt_{str*cmp,strlen} and use them all over the
place. If there are still segmentation faults due to missing
NONULLs over, they are gone now.
Diffstat (limited to 'edit.c')
-rw-r--r-- | edit.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -66,7 +66,7 @@ be_snarf_data (FILE *f, char **buf, int *bufmax, int *buflen, int offset, if (prefix) { strfcpy (tmp, NONULL(Prefix), sizeof (tmp)); - tmplen = strlen (tmp); + tmplen = mutt_strlen (tmp); p = tmp + tmplen; tmplen = sizeof (tmp) - tmplen; } @@ -75,7 +75,7 @@ be_snarf_data (FILE *f, char **buf, int *bufmax, int *buflen, int offset, while (bytes > 0) { if (fgets (p, tmplen - 1, f) == NULL) break; - bytes -= strlen (p); + bytes -= mutt_strlen (p); if (*bufmax == *buflen) safe_realloc ((void **)&buf, sizeof (char *) * (*bufmax += 25)); buf[(*buflen)++] = safe_strdup (tmp); @@ -327,7 +327,7 @@ int mutt_builtin_editor (const char *path, HEADER *msg, HEADER *cur) if (EscChar && tmp[0] == EscChar[0] && tmp[1] != EscChar[0]) { /* remove trailing whitespace from the line */ - p = tmp + strlen (tmp) - 1; + p = tmp + mutt_strlen (tmp) - 1; while (p >= tmp && ISSPACE (*p)) *p-- = 0; @@ -359,8 +359,8 @@ int mutt_builtin_editor (const char *path, HEADER *msg, HEADER *cur) if (!*p && cur) { /* include the current message */ - p = tmp + strlen (tmp) + 1; - snprintf (tmp + strlen (tmp), sizeof (tmp) - strlen (tmp), " %d", + p = tmp + mutt_strlen (tmp) + 1; + snprintf (tmp + mutt_strlen (tmp), sizeof (tmp) - mutt_strlen (tmp), " %d", cur->msgno + 1); } buf = be_include_messages (p, buf, &bufmax, &buflen, @@ -404,7 +404,7 @@ int mutt_builtin_editor (const char *path, HEADER *msg, HEADER *cur) { buflen--; strfcpy (tmp, buf[buflen], sizeof (tmp)); - tmp[strlen (tmp)-1] = 0; + tmp[mutt_strlen (tmp)-1] = 0; FREE (&buf[buflen]); buf[buflen] = NULL; continue; @@ -443,7 +443,7 @@ int mutt_builtin_editor (const char *path, HEADER *msg, HEADER *cur) break; } } - else if (strcmp (".", tmp) == 0) + else if (mutt_strcmp (".", tmp) == 0) done = 1; else { |