diff options
Diffstat (limited to 'ncurses/trace/trace_buf.c')
-rw-r--r-- | ncurses/trace/trace_buf.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/ncurses/trace/trace_buf.c b/ncurses/trace/trace_buf.c index 46baba4..84a7a0c 100644 --- a/ncurses/trace/trace_buf.c +++ b/ncurses/trace/trace_buf.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. * + * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -35,7 +35,7 @@ #include <curses.priv.h> -MODULE_ID("$Id: trace_buf.c,v 1.17 2011/01/22 19:48:16 tom Exp $") +MODULE_ID("$Id: trace_buf.c,v 1.20 2012/02/22 22:34:31 tom Exp $") #ifdef TRACE @@ -103,13 +103,14 @@ _nc_trace_buf(int bufnum, size_t want) NCURSES_EXPORT(char *) _nc_trace_bufcat(int bufnum, const char *value) { - char *buffer = _nc_trace_alloc(bufnum, 0); + char *buffer = _nc_trace_alloc(bufnum, (size_t) 0); if (buffer != 0) { size_t have = strlen(buffer); + size_t need = strlen(value) + have; - buffer = _nc_trace_alloc(bufnum, 1 + have + strlen(value)); + buffer = _nc_trace_alloc(bufnum, 1 + need); if (buffer != 0) - (void) strcpy(buffer + have, value); + _nc_STRCPY(buffer + have, value, need); } return buffer; |