diff options
| author | 2014-10-22 20:52:02 +0200 | |
|---|---|---|
| committer | 2014-10-22 22:21:06 +0200 | |
| commit | 57538472cb86d6b376f933e9e416eb769f7c00b7 (patch) | |
| tree | e0cff41e2924c759295526e37d43086db664eb19 /common | |
| parent | 067c7c682614fbf0b7aeb13fd8b8ba7dc4fd8bf2 (diff) | |
| download | libimobiledevice-57538472cb86d6b376f933e9e416eb769f7c00b7.tar.gz libimobiledevice-57538472cb86d6b376f933e9e416eb769f7c00b7.tar.bz2 | |
common: Move string_toupper() helper to utils and use it in idevicebackup tools
Diffstat (limited to 'common')
| -rw-r--r-- | common/utils.c | 10 | ||||
| -rw-r--r-- | common/utils.h | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/common/utils.c b/common/utils.c index fb6822f..f95ecfd 100644 --- a/common/utils.c +++ b/common/utils.c | |||
| @@ -139,6 +139,16 @@ char *string_build_path(const char *elem, ...) | |||
| 139 | return out; | 139 | return out; |
| 140 | } | 140 | } |
| 141 | 141 | ||
| 142 | char *string_toupper(char* str) | ||
| 143 | { | ||
| 144 | char *res = strdup(str); | ||
| 145 | unsigned int i; | ||
| 146 | for (i = 0; i < strlen(res); i++) { | ||
| 147 | res[i] = toupper(res[i]); | ||
| 148 | } | ||
| 149 | return res; | ||
| 150 | } | ||
| 151 | |||
| 142 | static int get_rand(int min, int max) | 152 | static int get_rand(int min, int max) |
| 143 | { | 153 | { |
| 144 | int retval = (rand() % (max - min)) + min; | 154 | int retval = (rand() % (max - min)) + min; |
diff --git a/common/utils.h b/common/utils.h index 96e6ba2..5cd4a53 100644 --- a/common/utils.h +++ b/common/utils.h | |||
| @@ -38,6 +38,7 @@ char *stpcpy(char *s1, const char *s2); | |||
| 38 | #endif | 38 | #endif |
| 39 | char *string_concat(const char *str, ...); | 39 | char *string_concat(const char *str, ...); |
| 40 | char *string_build_path(const char *elem, ...); | 40 | char *string_build_path(const char *elem, ...); |
| 41 | char *string_toupper(char *str); | ||
| 41 | char *generate_uuid(); | 42 | char *generate_uuid(); |
| 42 | 43 | ||
| 43 | void buffer_read_from_filename(const char *filename, char **buffer, uint64_t *length); | 44 | void buffer_read_from_filename(const char *filename, char **buffer, uint64_t *length); |
