X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Fgdc.c;h=0c48ffbedfa78292b7979dda6ff90c75ac059cd4;hp=45eb39f4514a02f7a74a109cdada0acdb5bdd56a;hb=1dd25cc0259e0683290fe889707b04979b5fda0a;hpb=73b54c0812e4b8dfddcf87f59c7488bb3c10e10d diff --git a/test/gdc.c b/test/gdc.c index 45eb39f4..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.41 2014/08/02 16:36:20 tom Exp $ + * $Id: gdc.c,v 1.45 2016/09/10 21:47:55 tom Exp $ */ #include @@ -121,13 +121,13 @@ standt(int on) { if (on) { if (hascolor) { - attron((attr_t) COLOR_PAIR(PAIR_DIGITS)); + attron(COLOR_PAIR(PAIR_DIGITS)); } else { attron(A_STANDOUT); } } else { if (hascolor) { - attron((attr_t) COLOR_PAIR(PAIR_OTHERS)); + attron(COLOR_PAIR(PAIR_OTHERS)); } else { attroff(A_STANDOUT); } @@ -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);