$OpenBSD: patch-wmWeather_c,v 1.1.1.1 2001/01/09 22:13:42 naddy Exp $ --- Src/wmWeather.c.orig Tue May 4 22:20:04 1999 +++ Src/wmWeather.c Tue Jan 9 18:54:59 2001 @@ -229,12 +229,12 @@ char dir[5]; int Year, Month, Day; int Hours, Mins, Secs; int UpdateLTHour = 0.0, UpdateLTMin = 0.0, UpdateUTHour, UpdateUTMin; -long CurrentLocalTime; +time_t CurrentLocalTime; double UpdateUT, UpdateLT, UT, LT, DT, hour24(); double jd(), CurrentJD; -char command[1024], Line[512], FileName[10]; +char command[1024], Line[512], FileName[1024]; int Tens, q, digit, chr; double Pressure, Temperature, sgn, Humidity, DewPoint, WindChill, val; double Direction, Speed; @@ -416,7 +416,7 @@ FILE *fp; /* * Read in weather data */ - sprintf(FileName, "%s/.wmWeatherReports/%s.dat", getenv("HOME"), StationID); + snprintf(FileName, sizeof(FileName), "%s/.wmWeatherReports/%s.dat", getenv("HOME"), StationID); if ((fp = fopen(FileName, "r")) != NULL){ fgets(Line, 512, fp); @@ -713,7 +713,7 @@ FILE *fp; q = 0; i = (int)(Direction/360.0*16.0 + 0.5); if (i>15) i = 0; - strcpy(dir, CompassDirection[i]); + strlcpy(dir, CompassDirection[i], sizeof(dir)); len = strlen(dir); for (j=0; j