nmh-workers
[Top] [All Lists]

Re: [Nmh-workers] sbr/fmt_scan.c: cpstripped(): assert(w >= 0) Failure.

2017-04-24 20:20:16
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

_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers

<Prev in Thread] Current Thread [Next in Thread>