diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2020-02-02 17:14:32 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2020-02-02 17:14:32 +0100 |
commit | 5dadc28ea784db1ba1f56c2ea8618d2db67af1c8 (patch) | |
tree | 808b2499b54563b3290f34d70d159b1024310873 /backend/umax_pp_low.c | |
parent | 5bb4cf12855ec0151de15d6c5a2354ff08766957 (diff) | |
parent | 3dade5db2a37543f19f0967901d8d80a52a1e459 (diff) |
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'backend/umax_pp_low.c')
-rw-r--r-- | backend/umax_pp_low.c | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/backend/umax_pp_low.c b/backend/umax_pp_low.c index c5d9a93..ddcf3da 100644 --- a/backend/umax_pp_low.c +++ b/backend/umax_pp_low.c @@ -924,7 +924,7 @@ sanei_parport_find_device (void) int -sanei_umax_pp_initPort (int port, char *name) +sanei_umax_pp_initPort (int port, const char *name) { #ifndef IO_SUPPORT_MISSING # ifdef HAVE_LINUX_PPDEV_H @@ -1027,26 +1027,20 @@ sanei_umax_pp_initPort (int port, char *name) } else { - sprintf (strmodes, "\n"); - if (modes & PARPORT_MODE_PCSPP) - sprintf (strmodes, "%s\t\tPARPORT_MODE_PCSPP\n", - strmodes); - if (modes & PARPORT_MODE_TRISTATE) - sprintf (strmodes, "%s\t\tPARPORT_MODE_TRISTATE\n", - strmodes); - if (modes & PARPORT_MODE_EPP) - sprintf (strmodes, "%s\t\tPARPORT_MODE_EPP\n", strmodes); + snprintf(strmodes, sizeof(strmodes), + "\n%s%s%s%s%s%s", + (modes & PARPORT_MODE_PCSPP)? "\t\tPARPORT_MODE_PCSPP\n": "", + (modes & PARPORT_MODE_TRISTATE)? "\t\tPARPORT_MODE_TRISTATE\n": "", + (modes & PARPORT_MODE_EPP)? "\t\tPARPORT_MODE_EPP\n": "", + (modes & PARPORT_MODE_ECP)? "\t\tPARPORT_MODE_ECP\n": "", + (modes & PARPORT_MODE_COMPAT)? "\t\tPARPORT_MODE_COMPAT\n": "", + (modes & PARPORT_MODE_DMA)? "\t\tPARPORT_MODE_DMA\n": ""); + if (modes & PARPORT_MODE_ECP) { - sprintf (strmodes, "%s\t\tPARPORT_MODE_ECP\n", - strmodes); gECP = 1; } - if (modes & PARPORT_MODE_COMPAT) - sprintf (strmodes, "%s\t\tPARPORT_MODE_COMPAT\n", - strmodes); - if (modes & PARPORT_MODE_DMA) - sprintf (strmodes, "%s\t\tPARPORT_MODE_DMA\n", strmodes); + DBG (32, "parport modes: %X\n", modes); DBG (32, "parport modes: %s\n", strmodes); if (!(modes & PARPORT_MODE_EPP) @@ -10239,7 +10233,7 @@ moveToOrigin (void) end[0] = 0x19; end[1] = 0xD5; end[4] = 0x1B; - + // fall through case 1220: case 2000: w = 300; @@ -11226,6 +11220,7 @@ sanei_umax_pp_startScan (int x, int y, int width, int height, int dpi, } else y += 80; + // fall through default: y += 8; break; |