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>
This commit is contained in:
@ -631,6 +631,7 @@ typedef struct WIN_t {
|
||||
/*------ Low Level Memory/Keyboard/File I/O support --------------------*/
|
||||
//atic void *alloc_c (size_t num);
|
||||
//atic void *alloc_r (void *ptr, size_t num);
|
||||
//atic char *alloc_s (const char *str);
|
||||
//atic inline int ioa (struct timespec *ts);
|
||||
//atic int ioch (int ech, char *buf, unsigned cnt);
|
||||
//atic int iokey (int init);
|
||||
|
Reference in New Issue
Block a user