diff options
| author | hibby <d@vehibberd.com> | 2026-10-06 21:24:40 +0100 |
|---|---|---|
| committer | hibby <d@vehibberd.com> | 2026-10-06 21:24:40 +0100 |
| commit | c25cbdf6fb6d946175f4335fab77bfea601b56db (patch) | |
| tree | 6f7a94b7b81f999e434f61b73d47e337dfd26bf2 /lib/ptt.c | |
| parent | 71f5689252c9f13e70e1c24856904475b2307809 (diff) | |
| parent | 0685fcada9f95fe90f70b387cd7d757da8209624 (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 'lib/ptt.c')
| -rw-r--r-- | lib/ptt.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -5,8 +5,8 @@ int ptt_(int *nport, int *ntx, int *iptt) { static HANDLE hFile; static int open=0; - char s[10]; - int i3=1,i4=1,i5=1,i6=1,i9=1,i00=1; + char s[32]; + int i3=1,i4=1,i5=1,i6=1,i9=1,i00=1,n; if(*nport==0) { *iptt=*ntx; @@ -14,7 +14,8 @@ int ptt_(int *nport, int *ntx, int *iptt) } if(*ntx && (!open)) { - sprintf(s,"\\\\.\\COM%d",*nport); + n=snprintf(s,sizeof s,"\\\\.\\COM%d",*nport); + if(n < 0 || n >= (int) sizeof s) return 1; hFile=CreateFile(TEXT(s),GENERIC_WRITE,0,NULL,OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,NULL); if(hFile==INVALID_HANDLE_VALUE) { |
