diff options
| author | Christoph Berg <myon@debian.org> | 2026-09-26 23:24:03 +0200 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2026-09-26 23:24:03 +0200 |
| commit | 059831534c7e884f0a607ed86b582fd00d821731 (patch) | |
| tree | 76bcb67a78f8aa2654fd34c2ad801a62136b0170 /lib/ptt.c | |
| parent | d83a420f0517d7fc47aeb288a6a0cf4891784fcc (diff) | |
New upstream version 3.2.0~rc1+dfsgupstream/3.2.0_rc1+dfsg
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) { |
