Skip to content

Commit 9503635

Browse files
authored
vt pdckbd (PDC_get_key): fix missing init warnings
fixes #373 some of the variables are passed as pointers to sub-functions but may not always be set - explicit initialize to fix the init-warning this results in
1 parent ac2c544 commit 9503635

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

vt/pdckbd.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -307,16 +307,15 @@ int PDC_get_key( void)
307307
}
308308
if( check_key( &rval))
309309
{
310-
int c[MAX_COUNT], modifiers = 0;
310+
int c[MAX_COUNT] = { 0 }, modifiers = 0;
311311

312312
#ifdef USE_CONIO
313313
if( rval == 0 || rval == 224)
314314
{
315-
int key2;
316-
317-
#ifdef __DJGPP__ /* DJGPP returns kbhit() = 1 only once for */
318-
key2 = dmc_getch( ); /* escape sequences, not twice as other */
319-
#else /* compilers for MS-DOS do */
315+
#ifdef __DJGPP__ /* DJGPP returns kbhit() = 1 only once for */
316+
int key2 = dmc_getch( ); /* escape sequences, not twice as other */
317+
#else /* compilers for MS-DOS do */
318+
int key2 = 0;
320319
while( !check_key( &key2))
321320
;
322321
#endif

0 commit comments

Comments
 (0)