#1152909 barnowl: exits with usage message at startup on arm64 and other unsigned-char architectures

Package:
barnowl
Source:
barnowl
Description:
A curses-based tty Jabber, IRC, AIM and Zephyr client
Submitter:
Daniel Clark
Date:
2026-11-03 01:47:02 UTC
Severity:
normal
Tags:
#1152909#5
Date:
2026-11-03 01:44:37 UTC
From:
To:
On arm64, barnowl cannot start: run with no arguments, it prints its
version and the usage message
and exits 1.

In owl.c, owl_parse_options() keeps getopt_long()'s return value in a "char
c". Where plain char is
unsigned (arm64, armhf, ppc64el, s390x, riscv64), the -1 that ends option
parsing is stored as 255,
so "(c = getopt_long(...)) != -1" is never false and the loop reaches the
switch's default case,
which prints usage and exits.

Reproduced on a clean debian:trixie container on an aarch64 host, barnowl
1.10-2+b9:

  $ barnowl
  BarnOwl version 1.10
  Usage: barnowl [-n] [-d] [-D] [-v] [-h] [-c <configfile>] [-s <confdir>]
[-t <ttyname>]
  [...]
  $ echo $?
  1

Log: https://github.com/djbclark/barnowl/actions/runs/41559344608

The same line is in upstream master (1f65aee). The fix, offered upstream as
https://github.com/barnowl/barnowl/pull/191:
--- a/owl.c
+++ b/owl.c
@@ -58,7 +58,7 @@ void owl_parse_options(int argc, char *argv[],
owl_options *opts) {
     { "help",            0, 0, 'h' },
     { NULL, 0, NULL, 0}
   };
-  char c;
+  int c;

   while((c = getopt_long(argc, argv, "nc:t:s:dDvh",
                          long_options, NULL)) != -1) {