mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-06-30 11:02:48 -05:00
Oops, Ben is quite right about the rather appalling design of
filename_from_str. Here's a better fix, with some const repercussions too. [originally from svn r2768]
This commit is contained in:
@ -18,7 +18,7 @@ unsigned long getticks(void)
|
||||
return tv.tv_sec * 1000000 + tv.tv_usec;
|
||||
}
|
||||
|
||||
Filename filename_from_str(char *str)
|
||||
Filename filename_from_str(const char *str)
|
||||
{
|
||||
Filename ret;
|
||||
strncpy(ret.path, str, sizeof(ret.path));
|
||||
@ -26,9 +26,9 @@ Filename filename_from_str(char *str)
|
||||
return ret;
|
||||
}
|
||||
|
||||
char *filename_to_str(Filename fn)
|
||||
const char *filename_to_str(const Filename *fn)
|
||||
{
|
||||
return fn.path;
|
||||
return fn->path;
|
||||
}
|
||||
|
||||
int filename_equal(Filename f1, Filename f2)
|
||||
|
@ -208,7 +208,8 @@ void try_output(int is_stderr)
|
||||
}
|
||||
}
|
||||
|
||||
int from_backend(void *frontend_handle, int is_stderr, char *data, int len)
|
||||
int from_backend(void *frontend_handle, int is_stderr,
|
||||
const char *data, int len)
|
||||
{
|
||||
int osize, esize;
|
||||
|
||||
|
Reference in New Issue
Block a user