On Tue, Sep 22, 2020 at 02:29:10PM +0300, Andy Shevchenko wrote:
On Tue, Sep 22, 2020 at 11:04:31AM +0000, Rojewski, Cezary wrote:
On 2020-09-22 11:04 AM, Andy Shevchenko wrote:
On Mon, Sep 21, 2020 at 08:48:12PM +0000, Rojewski, Cezary wrote:
...
And here basically enough check is info against NULL, right? Just try to look at different possibilities how to make code simpler and neater.
Didn't compile this, some typecheck fixes might be in order and so on.
What you meant is: if (i == 4 && !info) // instead of 'info < eof'
right?
Simply if (!info)...
if (info) memcpy();
of course, otherwise it will crash.
If 4th space is last char in this string then info would end up being non-NULL and equal to 'eof' and thus memcpy() would get invoked with size=eof-info=0.
...which is not a problem.