gbranden pushed a commit to branch master
in repository groff.
commit f6fa81eece8cf59afc250dda78cdab8fd9628d3e
Author: G. Branden Robinson <[email protected]>
AuthorDate: Fri Oct 18 17:51:48 2024 -0500
[pfbtops]: Use assert() to catch programmer error.
* src/utils/pfbtops/pfbtops.c (main): Call `assert()` to catch
programmer error in command-line option handling.
---
ChangeLog | 5 +++++
src/utils/pfbtops/pfbtops.c | 3 +++
2 files changed, 8 insertions(+)
diff --git a/ChangeLog b/ChangeLog
index 025639725..759444b74 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-10-18 G. Branden Robinson <[email protected]>
+
+ * src/utils/pfbtops/pfbtops.c (main): Call `assert()` to catch
+ programmer error in command-line option handling.
+
2024-10-18 G. Branden Robinson <[email protected]>
* src/utils/lookbib/lookbib.cpp (main): Make `assert()` message
diff --git a/src/utils/pfbtops/pfbtops.c b/src/utils/pfbtops/pfbtops.c
index 8fbe44a79..8479739cb 100644
--- a/src/utils/pfbtops/pfbtops.c
+++ b/src/utils/pfbtops/pfbtops.c
@@ -24,6 +24,7 @@ along with this program. If not, see
<http://www.gnu.org/licenses/>. */
#define __GETOPT_PREFIX groff_
+#include <assert.h> // assert()
#include <errno.h> // errno
#include <stdio.h>
#include <stdlib.h> // exit(), EXIT_FAILURE, EXIT_SUCCESS
@@ -193,6 +194,8 @@ int main(int argc, char **argv)
usage(stderr);
exit(2);
break;
+ default:
+ assert(0 == "unhandled case of command-line option");
}
}
_______________________________________________
Groff-commit mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/groff-commit