nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] fixing the tickle (was: Smooth Horizontal Scroll patch)


From: Mark Majeres
Subject: Re: [Nano-devel] fixing the tickle (was: Smooth Horizontal Scroll patch)
Date: Tue, 20 May 2014 06:30:21 -0700

Benno,

The line that I initially noticed was from text.c.
data = (char *) nrealloc((void *) u->strdata, len * sizeof(char *));

There is a macro named charealloc that is usually used for this situation.
#define charealloc(ptr, howmuch) (char *)nrealloc(ptr, (howmuch) * sizeof(char))

Not really a problem, there is just more memory being allocated than needed.
I think there is only one more case similar to the above, it's in do_lockfile()

Otherwise, it does look like sizeof(char*) applies.  I usually create
a #define for this situation to clarify that it's not a mistake.

#define SIZEOF_PTR sizeof(void*)


-Mark



reply via email to

[Prev in Thread] Current Thread [Next in Thread]