From bc7d32a6e684b7851658d0ec38ac86814c725322 Mon Sep 17 00:00:00 2001 From: Jan Baier Date: Wed, 14 Aug 2024 14:12:31 +0200 Subject: [PATCH] Fix segfault when using --force-tape-width without printer When force_tape_width is *not* used it is expected to open/close the usb device. --- src/ptouch-print.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ptouch-print.c b/src/ptouch-print.c index 600261a..6c382af 100644 --- a/src/ptouch-print.c +++ b/src/ptouch-print.c @@ -648,7 +648,7 @@ int main(int argc, char *argv[]) if (im != NULL) { gdImageDestroy(im); } - if (forced_tape_width > 0) { + if (!forced_tape_width) { ptouch_close(ptdev); } libusb_exit(NULL);