summaryrefslogtreecommitdiff
path: root/map65/libm65/ptt.c
diff options
context:
space:
mode:
authorhibby <d@vehibberd.com>2026-10-06 21:24:40 +0100
committerhibby <d@vehibberd.com>2026-10-06 21:24:40 +0100
commitc25cbdf6fb6d946175f4335fab77bfea601b56db (patch)
tree6f7a94b7b81f999e434f61b73d47e337dfd26bf2 /map65/libm65/ptt.c
parent71f5689252c9f13e70e1c24856904475b2307809 (diff)
parent0685fcada9f95fe90f70b387cd7d757da8209624 (diff)
Merge tag 'debian/3.2.0_rc1+dfsg-2' into debian/trixie-backportsdebian/trixie-backports
tagging wsjtx 3.2.0~rc1+dfsg-2
Diffstat (limited to 'map65/libm65/ptt.c')
-rw-r--r--map65/libm65/ptt.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/map65/libm65/ptt.c b/map65/libm65/ptt.c
index 0f99d1be..b2c6cb48 100644
--- a/map65/libm65/ptt.c
+++ b/map65/libm65/ptt.c
@@ -5,7 +5,7 @@ int ptt_(int *nport, int *ntx, int *iptt)
{
static HANDLE hFile;
static int open=0;
- char s[10];
+ char s[64];
int i3=0,i4=0,i5=0,i6=0,i9=0,i00=0;
if(*nport==0) {
@@ -14,13 +14,19 @@ int ptt_(int *nport, int *ntx, int *iptt)
}
if(*ntx && (!open)) {
- sprintf(s,"COM%d",*nport);
- hFile=CreateFile(TEXT(s),GENERIC_WRITE,0,NULL,OPEN_EXISTING,
+ if (*nport < 10)
+ snprintf(s, sizeof(s), "COM%d", *nport);
+ else
+ snprintf(s, sizeof(s), "\\\\.\\COM%d", *nport);
+
+ hFile = CreateFileA(s, GENERIC_WRITE, 0, NULL, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,NULL);
+
if(hFile==INVALID_HANDLE_VALUE) {
// printf("PTT: Cannot open COM port %d.\n",*nport);
return 1;
}
+
open=1;
}