]> granicus.if.org Git - procps-ng/commit
top: end reliance on strdup not failing & roll our own
authorJim Warner <james.warner@comcast.net>
Mon, 11 Feb 2013 06:00:00 +0000 (00:00 -0600)
committerCraig Small <csmall@enc.com.au>
Sat, 23 Feb 2013 21:43:44 +0000 (08:43 +1100)
commitc856a80ad57d5ad66fcc68e1c06b2c0216e25e60
tree5b95399cc5416e1b2c0ed8ae0db4e1e8a5890060
parent44e61f0f6debc5fd24dd78544a11bddc4f3d8204
top: end reliance on strdup not failing & roll our own

Lately, top has begun to rely more and more on dynamic
memory allocations rather than the static buffers that
were found in many of its structures. This was perhaps
most evident in the increasing use of the strdup call.

This commit trades that function call for the internal
equivalent which will protect us from malloc failures.

(everything is perfectly justified plus right margins)
(are completely filled, but of course it must be luck)

Signed-off-by: Jim Warner <james.warner@comcast.net>
top/top.c
top/top.h