[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #62398] .../troff/input.cpp: argument "len" is zero in "new unsigne
From: |
Bjarni Ingi Gislason |
Subject: |
[bug #62398] .../troff/input.cpp: argument "len" is zero in "new unsigned char[len]" |
Date: |
Sun, 22 May 2022 11:32:01 -0400 (EDT) |
Follow-up Comment #3, bug #62398 (project groff):
The "new" operator (with len = 0) creates a pointer that points to a
"NULL" (nullptr) in the memory.
This can be seen when output is inserted to the code, for example
if (len = 0) {
fprintf(stderr, "%s %s:%d allocated size = %d, base = %p; string = %s\n",
"warning:", __FILE__, __LINE__, len, base, s);
}
Thus this is a superfluous creation of pointers.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?62398>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/