Program to convert pieces from ZIICS format to XPM & XIM format.
(C version) By Frank McIngvale <frankm@hiwaay.net>.
- Copyright (C) 1996 Free Software Foundation, Inc.
+ Copyright (C) 1996, 2009, 2010, 2011 Free Software Foundation, Inc.
NOTICE: The piece images distributed with ZIICS are
copyrighted works of their original creators. Images
by experimentation, and without access to any
of Borland Inc.'s BGI library source code.
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version. However, the above notices
- MUST BE RETAINED in any copy that you redistribute or modify.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+ GNU XBoard is free software: you can redistribute it
+ and/or modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation,
+ either version 3 of the License, or (at your option) any
+ later version.
+
+ GNU XBoard is distributed in the hope that it will be
+ useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ PURPOSE. See the GNU General Public License for more
+ details.
+
+ You should have received a copy of the GNU General Public
+ License along with this program. If not, see
+ http://www.gnu.org/licenses/.
- You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111 USA.
** If you find a bug in zic2xpm.c, please report it to me,
Frank McIngvale (frankm@hiwaay.net) so that I may fix it. **
} z2xpm;
#define NR_ZIICS_COLORS 4
+#define BUFLEN 100
/* SHOWSETS.PAS (from ZIICS) states that images may only
use color numbers 0, 2, 14, and 15 */
int nr_pieces = 6;
int nr_kinds = 4;
FILE *fp;
- char buf[100];
+ char buf[BUFLEN];
src_name = filename;
{
printf( "." );
/* Form output filename -- <piece><kind><size>.xim */
- sprintf(buf, "%c%s%d.xim", pieces[piece], prefixes[kind], w);
+ snprintf(buf, BUFLEN, "%c%s%d.xim", pieces[piece], prefixes[kind], w);
create_piece_xim( buf, fp, w, h );
}
printf("\n");
}
/* Write the light & dark squares */
- sprintf( buf, "lsq%d.xim", w );
+ snprintf( buf, BUFLEN, "lsq%d.xim", w );
printf("Light Square" );
create_piece_xim( buf, fp, w, h );
- sprintf( buf, "dsq%d.xim", w );
+ snprintf( buf, BUFLEN, "dsq%d.xim", w );
printf("\nDark Square" );
create_piece_xim( buf, fp, w, h );
printf("\n");
int nr_pieces = 6;
int nr_kinds = 4;
FILE *fp;
- char buf[100];
+ char buf[BUFLEN];
src_name = filename;
{
printf( "." );
/* Form output filename -- <piece><kind><size>.xpm */
- sprintf(buf, "%c%s%d.xpm", pieces[piece], prefixes[kind], w);
+ snprintf(buf, BUFLEN, "%c%s%d.xpm", pieces[piece], prefixes[kind], w);
create_piece_xpm( buf, fp, w, h );
}
printf("\n");
}
/* Write the light & dark squares */
- sprintf( buf, "lsq%d.xpm", w );
+ snprintf( buf, BUFLEN, "lsq%d.xpm", w );
printf("Light Square" );
create_piece_xpm( buf, fp, w, h );
- sprintf( buf, "dsq%d.xpm", w );
+ snprintf( buf, BUFLEN, "dsq%d.xpm", w );
printf("\nDark Square" );
create_piece_xpm( buf, fp, w, h );
printf("\n");