History

address snprintf warnings

Ge Wang committed 3 years ago

Commit 2b091f41 parent af9e3622 files · +12 −5Browse files

Showing the changes to src/core/chuck_shell.cpp (1 of 2 files). Show all

Unified · Split

src/core/chuck_shell.cpp+5−3
@@ -1974,7 +1974,9 @@ t_CKINT Chuck_Shell::Command_VMSwap::execute( vector< string > & argv, · 1973 unmodified lines
1974t_CKINT Chuck_Shell::Command_VMList::execute( vector< string > & argv,1974t_CKINT Chuck_Shell::Command_VMList::execute( vector< string > & argv,
1975 string & out )1975 string & out )
1976{1976{
1977 char buf[16];1977 // 1.5.0.1 (ge) changed from 16 to 32;
1978 // the former not long enough for big 64-bit numbers
1979 char buf[32];
1978 vector<string>::size_type i, len = caller->vms.size();1980 vector<string>::size_type i, len = caller->vms.size();
1979 1981
1980 if( caller->current_vm != NULL )1982 if( caller->current_vm != NULL )
@@ -1985,9 +1987,9 @@ t_CKINT Chuck_Shell::Command_VMList::execute( vector< string > & argv, · 4 unmodified lines
1985 if( caller->vms[i] != NULL )1987 if( caller->vms[i] != NULL )
1986 {1988 {
1987#ifndef __PLATFORM_WIN32__1989#ifndef __PLATFORM_WIN32__
1988 snprintf( buf, 16, "%lu", i );1990 snprintf( buf, 32, "%lu", i );
1989#else1991#else
1990 snprintf( buf, 16, "%lu", (long)i );1992 snprintf( buf, 32, "%lu", (long)i );
1991#endif // __PLATFORM_WIN32__1993#endif // __PLATFORM_WIN32__
1992 out += string( "VM " ) + buf + ": " +1994 out += string( "VM " ) + buf + ": " +
1993 caller->vms[i]->fullname() + "\n";1995 caller->vms[i]->fullname() + "\n";

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t