FreeBSD Bugzilla – Attachment 174039 Details for
Bug 212126
x11/temperature.app: noaa URL no longer works
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch for Temperature.cc
patch-Temperature.cc (text/plain), 1.96 KB, created by
manny
on 2016-08-25 02:00:49 UTC
(
hide
)
Description:
Patch for Temperature.cc
Filename:
MIME Type:
Creator:
manny
Created:
2016-08-25 02:00:49 UTC
Size:
1.96 KB
patch
obsolete
>--- Temperature.cc.bak 2016-08-24 21:28:41.551324000 -0400 >+++ Temperature.cc 2016-08-24 21:26:25.860220000 -0400 >@@ -20,24 +20,29 @@ > // > > #include <X11/Xlib.h> >-#include <iostream.h> >-#include <fstream.h> >-#include <stdlib.h> >-#include <stdio.h> >-#include <string.h> >+#include <iostream> >+#include <fstream> >+#include <cstdlib> >+#include <cstdio> >+#include <cstring> > #include <unistd.h> >-#include <signal.h> >-#include <errno.h> >+#include <csignal> >+#include <cerrno> > #include <sys/types.h> > #include <sys/wait.h> >-#include <math.h> >-#include <time.h> >+#include <cmath> >+#include <ctime> > #include "Xpm.h" > #include "Temperature.h" > > #include "pixmaps/main.xpm" > #include "pixmaps/redlight.xpm" > >+using std::cerr; >+using std::cout; >+using std::endl; >+using std::fstream; >+ > volatile static ChildStatus childStatus; > > static void catchBrokenPipe(int sig) >@@ -357,13 +362,13 @@ > if (!strcmp(buffer, "Temperature:")) { > file >> buffer; > if (buffer && strlen(buffer) < 5) { >- char* unit; >+ char unit[3]; > if (mFahrenheit) { > strcpy(mTemperature, buffer); >- unit = " °F"; >+ sprintf(unit," F\0"); > } else { > sprintf(mTemperature, "%d", (int)rint((atoi(buffer) - 32) / 1.8)); >- unit = " °C"; >+ sprintf(unit," C\0"); > } > > Xpm* image = new Xpm(mDisplay, mRoot, main_xpm); >@@ -415,7 +420,7 @@ > const char* verbose = (mVerbose ? "--verbose" : "--quiet"); > char* URL = new char[strlen(METAR_URL) + strlen(mStationId) + 1]; > sprintf(URL, METAR_URL, mStationId); >- execlp("wget", "wget", "--cache=off", "--tries=0", verbose, "-O", tmpFile, URL, 0); >+ execlp("wget", "wget", "--no-cache", "--tries=0", verbose, "-O", tmpFile, URL, 0); > cerr << APPNAME << ": could not fetch temperature (wget not found in $PATH)" << endl; > remove(tmpFile); > exit(0);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 212126
: 174039 |
174040