Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FTBFS when ENABLE_CURSES=ON and ncurses >= 6.3 #2

Open
kathenas opened this issue Mar 11, 2023 · 1 comment
Open

FTBFS when ENABLE_CURSES=ON and ncurses >= 6.3 #2

kathenas opened this issue Mar 11, 2023 · 1 comment

Comments

@kathenas
Copy link

Version: 5.2.0.

FTBFS when ENABLE_CURSES=ON and ncurses >= 6.3.

GCC >= 12.2.1.

/builddir/build/BUILD/bcunit-5.2.0/BCUnit/Sources/Curses/Curses.c:1161:39: error: format not a string literal and no format arguments [-Werror=format-security]

@kathenas
Copy link
Author

The above error is because most ditros have added this flag by default.

An easy fix, see below diff I have used for 5.2.0.

--- bcunit-5.2.0/BCUnit/Sources/Curses/Curses.c.orig
+++ bcunit-5.2.0/BCUnit/Sources/Curses/Curses.c
@@ -952,11 +952,11 @@
 
   snprintf(szTemp, STRING_LENGTH,   _("Commands:  R - run all tests in suite %s"),
                                     pSuite->pName);
-  mvwprintw(details_pad.pPad, 0, 0, szTemp);
+  mvwprintw(details_pad.pPad, 0, 0, "%s", szTemp);
   mvwprintw(details_pad.pPad, 1, 0, _("           S - Select and run a test"));
   snprintf(szTemp, STRING_LENGTH,   _("           L - List all tests registered in suite %s"),
                                     pSuite->pName);
-  mvwprintw(details_pad.pPad, 2, 0, szTemp);
+  mvwprintw(details_pad.pPad, 2, 0, "%s", szTemp);
   mvwprintw(details_pad.pPad, 3, 0, _("           A - Activate or deactivate a test (toggle)"));
   mvwprintw(details_pad.pPad, 4, 0, _("           F - Show failures from last test run"));
   mvwprintw(details_pad.pPad, 5, 0, _("           M - Move up to main menu"));
@@ -1068,14 +1068,14 @@
   }
 
   snprintf(szTemp, STRING_LENGTH, "%s: %s", _("Suite"), pSuite->pName);
-  mvwprintw(details_pad.pPad, 0, 0, szTemp);
+  mvwprintw(details_pad.pPad, 0, 0, "%s", szTemp);
 
   snprintf(szTemp, STRING_LENGTH,
            "%*s  %-*s%*s",
            width[0], _("#"),
            width[1], _("Test Name"),
            width[2], _("Active?"));
-  mvwprintw(details_pad.pPad, 1, 0, szTemp);
+  mvwprintw(details_pad.pPad, 1, 0, "%s", szTemp);
 
   for (i = 0, pCurTest = pSuite->pTest ;
        NULL != pCurTest ;
@@ -1158,7 +1158,7 @@
 
     snprintf(szTemp, STRING_LENGTH,   _("   1 - Inactive suites/tests treated as runtime failures     %s"),
                                       (CU_FALSE != CU_get_fail_on_inactive()) ? _("Yes") : _("No "));
-    mvwprintw(details_pad.pPad, 2, 0, szTemp);
+    mvwprintw(details_pad.pPad, 2, 0, "%s", szTemp);
     refresh_details_window();
     read_input_string(_("Enter number of option to change : "), szTemp, STRING_LENGTH);
     option_num = atol(szTemp);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant