mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-04-15 10:08:06 -05:00
Const-correctness in the debug functions!
I'm finding missing constifications all over the place this week. Turns out that dmemdump() has been taking a non-const memory pointer ever since the beginning, and it's never come up until now. How silly.
This commit is contained in:
parent
42c592c4ef
commit
a63435f6cc
6
misc.c
6
misc.c
@ -814,7 +814,7 @@ void safefree(void *ptr)
|
||||
#ifdef DEBUG
|
||||
extern void dputs(char *); /* defined in per-platform *misc.c */
|
||||
|
||||
void debug_printf(char *fmt, ...)
|
||||
void debug_printf(const char *fmt, ...)
|
||||
{
|
||||
char *buf;
|
||||
va_list ap;
|
||||
@ -827,10 +827,10 @@ void debug_printf(char *fmt, ...)
|
||||
}
|
||||
|
||||
|
||||
void debug_memdump(void *buf, int len, int L)
|
||||
void debug_memdump(const void *buf, int len, int L)
|
||||
{
|
||||
int i;
|
||||
unsigned char *p = buf;
|
||||
const unsigned char *p = buf;
|
||||
char foo[17];
|
||||
if (L) {
|
||||
int delta;
|
||||
|
4
misc.h
4
misc.h
@ -109,8 +109,8 @@ int match_ssh_id(int stringlen, const void *string, const char *id);
|
||||
*/
|
||||
|
||||
#ifdef DEBUG
|
||||
void debug_printf(char *fmt, ...);
|
||||
void debug_memdump(void *buf, int len, int L);
|
||||
void debug_printf(const char *fmt, ...);
|
||||
void debug_memdump(const void *buf, int len, int L);
|
||||
#define debug(x) (debug_printf x)
|
||||
#define dmemdump(buf,len) debug_memdump (buf, len, 0);
|
||||
#define dmemdumpl(buf,len) debug_memdump (buf, len, 1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user