X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Fgdc.c;h=0c48ffbedfa78292b7979dda6ff90c75ac059cd4;hp=04ea1b6b4c460154bb582c223bf3664b356caa1d;hb=c25392d9c21dd75537d50fc1705e938b0e813865;hpb=acc28c6418f43cbf15187f2f1fd9a562d5d96535 diff --git a/test/gdc.c b/test/gdc.c index 04ea1b6b..0c48ffbe 100644 --- a/test/gdc.c +++ b/test/gdc.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2013,2014 Free Software Foundation, Inc. * + * Copyright (c) 1998-2015,2016 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 * @@ -33,7 +33,7 @@ * modified 10-18-89 for curses (jrl) * 10-18-89 added signal handling * - * $Id: gdc.c,v 1.42 2014/08/09 22:28:42 tom Exp $ + * $Id: gdc.c,v 1.45 2016/09/10 21:47:55 tom Exp $ */ #include @@ -379,8 +379,12 @@ main(int argc, char *argv[]) } /* this depends on the detailed format of ctime(3) */ - (void) strncpy(buf, ctime(&now), (size_t) 30); - (void) strcpy(buf + 10, buf + 19); + _nc_STRNCPY(buf, ctime(&now), (size_t) 30); + { + char *d2 = buf + 10; + char *s2 = buf + 19; + while ((*d2++ = *s2++) != '\0') ; + } MvAddStr(16, 30, buf); move(6, 0);