diff options
Diffstat (limited to 'media-radio/flrig/files/vfprintf_bug.diff')
-rw-r--r-- | media-radio/flrig/files/vfprintf_bug.diff | 112 |
1 files changed, 112 insertions, 0 deletions
diff --git a/media-radio/flrig/files/vfprintf_bug.diff b/media-radio/flrig/files/vfprintf_bug.diff new file mode 100644 index 000000000000..168a8af859b2 --- /dev/null +++ b/media-radio/flrig/files/vfprintf_bug.diff @@ -0,0 +1,112 @@ +commit 224cde7b724f847f5f3018e22828308bf9355a7f +Author: David Freese <w1hkj@w1hkj.com> +Date: Thu Aug 29 13:18:06 2013 -0500 + + vfprintf bug on 64 bit Linux systems + + * removed use of vfprintf in debug.cxx + +diff --git a/src/debug.cxx b/src/debug.cxx +index d4dc4ac..1e64677 100644 +--- a/src/debug.cxx ++++ b/src/debug.cxx +@@ -125,8 +125,9 @@ void debug::log(level_e level, const char* func, const char* srcf, int line, con + va_start(args, format); + + vsnprintf(sztemp, sizeof(sztemp), fmt, args); ++ + estr.append(sztemp); +- vfprintf(wfile, fmt, args); ++ fprintf(wfile, "%s", sztemp); + + va_end(args); + +@@ -149,7 +150,7 @@ void debug::slog(level_e level, const char* func, const char* srcf, int line, co + + vsnprintf(sztemp, sizeof(sztemp), fmt, args); + estr.append(sztemp); +- vfprintf(wfile, fmt, args); ++ fprintf(wfile, "%s", sztemp); + va_end(args); + + fflush(wfile); +@@ -157,7 +158,8 @@ void debug::slog(level_e level, const char* func, const char* srcf, int line, co + if (tty) { + if (level <= DEBUG_LEVEL && level >= QUIET_LEVEL) { + va_start(args, format); +- vfprintf(stderr, fmt, args); ++ vsnprintf(sztemp, sizeof(sztemp), fmt, args); ++ fprintf(wfile, "%s", sztemp); + va_end(args); + } + } +diff --git a/src/dialogs.cxx b/src/dialogs.cxx +index 106fd40..aeeed3c 100644 +--- a/src/dialogs.cxx ++++ b/src/dialogs.cxx +@@ -138,7 +138,7 @@ void init_port_combos() + ssize_t len; + struct dirent* dp; + +- LOG_WARN("%s", "Searching /sys/class/tty/"); ++ LOG_INFO("%s", "Searching /sys/class/tty/"); + + while ((dp = readdir(sys))) { + # ifdef _DIRENT_HAVE_D_TYPE +@@ -152,7 +152,7 @@ void init_port_combos() + snprintf(ttyname, sizeof(ttyname), "/dev/%s", dp->d_name); + if (stat(ttyname, &st) == -1 || !S_ISCHR(st.st_mode)) + continue; +- LOG_WARN("Found serial port %s", ttyname); ++ LOG_INFO("Found serial port %s", ttyname); + add_combos(ttyname); + ret = true; + } +diff --git a/src/rig.cxx b/src/rig.cxx +index cd29649..c537719 100644 +--- a/src/rig.cxx ++++ b/src/rig.cxx +@@ -286,21 +286,6 @@ int main (int argc, char *argv[]) + RigHomeDir = dirbuf; + checkdirectories(); + +- progStatus.loadLastState(); +- +- if (progStatus.UIsize == small_ui) +- mainwindow = Small_rig_window(); +- else +- mainwindow = Wide_rig_window(); +- +- mainwindow->callback(exit_main); +- +- progStatus.UI_laststate(); +- +- fntbrowser = new Font_Browser; +- dlgMemoryDialog = Memory_Dialog(); +- dlgDisplayConfig = DisplayDialog(); +- + try { + debug::start(string(RigHomeDir).append("debug_log.txt").c_str()); + time_t t = time(NULL); +@@ -316,6 +301,21 @@ int main (int argc, char *argv[]) + exit(1); + } + ++ progStatus.loadLastState(); ++ ++ if (progStatus.UIsize == small_ui) ++ mainwindow = Small_rig_window(); ++ else ++ mainwindow = Wide_rig_window(); ++ ++ mainwindow->callback(exit_main); ++ ++ progStatus.UI_laststate(); ++ ++ fntbrowser = new Font_Browser; ++ dlgMemoryDialog = Memory_Dialog(); ++ dlgDisplayConfig = DisplayDialog(); ++ + Fl::lock(); + + #if defined(__WIN32__) && defined(PTW32_STATIC_LIB) |