Differences From Artifact [837f2ef174]:
- File misc.h — part of check-in [44f33ce7e0] at 2013-11-17 08:05:44 on branch trunk — Fix an assortment of dupprintf() format string bugs. I've enabled gcc's format-string checking on dupprintf, by declaring it in misc.h to have the appropriate GNU-specific attribute. This pointed out a selection of warnings, which I've fixed. (user: simon size: 3820)
To Artifact [089ffaadc7]:
- File misc.h — part of check-in [fb9857d0e6] at 2014-01-25 09:58:47 on branch trunk — New hostname-handling functions in misc.c. These are intended to make it easier to handle strings of the form "hostname:port" or other colon-separated things including hostnames (such as the -L and -R command-line option arguments), even though the hostname part might be a square-bracketed IPv6 address literal containing colons that have to _not_ be treated as separating the top-level string components. Three of these functions have semantics as much like existing C library functions as I could make them (host_strchr, host_strrchr, host_strcspn) so that it wouldn't be too error-prone to replace existing C functions with them at lots of call sites. The fourth function (host_strduptrim) just strips square brackets off anything that looks like an IPv6 literal. (user: simon size: 3995)
| ︙ | ︙ | |||
19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
#endif
typedef struct Filename Filename;
typedef struct FontSpec FontSpec;
unsigned long parse_blocksize(const char *bs);
char ctrlparse(char *s, char **next);
char *dupstr(const char *s);
char *dupcat(const char *s1, ...);
char *dupprintf(const char *fmt, ...)
#ifdef __GNUC__
__attribute__ ((format (printf, 1, 2)))
#endif
| > > > > > | 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
#endif
typedef struct Filename Filename;
typedef struct FontSpec FontSpec;
unsigned long parse_blocksize(const char *bs);
char ctrlparse(char *s, char **next);
size_t host_strcspn(const char *s, const char *set);
char *host_strchr(const char *s, int c);
char *host_strrchr(const char *s, int c);
char *host_strduptrim(const char *s);
char *dupstr(const char *s);
char *dupcat(const char *s1, ...);
char *dupprintf(const char *fmt, ...)
#ifdef __GNUC__
__attribute__ ((format (printf, 1, 2)))
#endif
|
| ︙ | ︙ |