[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Nmh-workers] sbr/fmt_scan.c: cpstripped(): assert(w >= 0) Failure.
From: |
David Levine |
Subject: |
Re: [Nmh-workers] sbr/fmt_scan.c: cpstripped(): assert(w >= 0) Failure. |
Date: |
Mon, 24 Apr 2017 21:20:02 -0400 |
I wrote:
> Right. If w < 0, bad things happen in the code just following. If
> w can indeed be negative there, maybe that code block should be simply
> skipped.
How about this:
@@ -300 +299,0 @@ cpstripped (charstring_t dest, size_t max, char *str)
- assert(w >= 0);
@@ -302,2 +301,4 @@ cpstripped (charstring_t dest, size_t max, char *str)
- charstring_push_back_chars (dest, altstr ? altstr : str, char_len,
w);
- max -= w;
+ if (w >= 0) {
+ charstring_push_back_chars (dest, altstr ? altstr : str,
char_len, w);
+ max -= w;
+ }
David