svn commit: r204693 - user/edwin/ncal
Edwin Groothuis
edwin at FreeBSD.org
Thu Mar 4 06:36:49 UTC 2010
Author: edwin
Date: Thu Mar 4 06:36:48 2010
New Revision: 204693
URL: http://svn.freebsd.org/changeset/base/204693
Log:
Replace random constant line lengths with #define constants.
Modified:
user/edwin/ncal/ncal.c
Modified: user/edwin/ncal/ncal.c
==============================================================================
--- user/edwin/ncal/ncal.c Thu Mar 4 06:36:00 2010 (r204692)
+++ user/edwin/ncal/ncal.c Thu Mar 4 06:36:48 2010 (r204693)
@@ -444,7 +444,7 @@ printeaster(int y, int julian, int ortho
{
date dt;
struct tm tm;
- char buf[80];
+ char buf[MAX_WIDTH];
static int d_first = -1;
if (d_first < 0)
@@ -489,8 +489,8 @@ monthrangeb(int y, int jd_flag, int m, i
{
struct monthlines year[12];
struct weekdays wds;
- char s[80], t[80];
- wchar_t ws[80], ws1[80];
+ char s[MAX_WIDTH], t[MAX_WIDTH];
+ wchar_t ws[MAX_WIDTH], ws1[MAX_WIDTH];
const char *wdss;
int i, j;
int mpl;
@@ -576,7 +576,7 @@ monthranger(int y, int jd_flag, int m, i
{
struct monthlines year[12];
struct weekdays wds;
- char s[80], t[80];
+ char s[MAX_WIDTH], t[MAX_WIDTH];
int i, j;
int mpl;
int mw;
@@ -981,7 +981,7 @@ sdateb(int nd, struct date *d)
char *
center(char *s, char *t, int w)
{
- char blanks[80];
+ char blanks[MAX_WIDTH];
memset(blanks, ' ', sizeof(blanks));
sprintf(s, "%.*s%s", (int)(w - strlen(t)) / 2, blanks, t);
@@ -992,7 +992,7 @@ center(char *s, char *t, int w)
wchar_t *
wcenter(wchar_t *s, wchar_t *t, int w)
{
- char blanks[80];
+ char blanks[MAX_WIDTH];
memset(blanks, ' ', sizeof(blanks));
swprintf(s, MAX_WIDTH, L"%.*s%ls", (int)(w - wcslen(t)) / 2, blanks, t);
More information about the svn-src-user
mailing list