From 57538472cb86d6b376f933e9e416eb769f7c00b7 Mon Sep 17 00:00:00 2001 From: Martin Szulecki Date: Wed, 22 Oct 2014 20:52:02 +0200 Subject: common: Move string_toupper() helper to utils and use it in idevicebackup tools --- common/utils.c | 10 ++++++++++ common/utils.h | 1 + 2 files changed, 11 insertions(+) (limited to 'common') 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, ...) return out; } +char *string_toupper(char* str) +{ + char *res = strdup(str); + unsigned int i; + for (i = 0; i < strlen(res); i++) { + res[i] = toupper(res[i]); + } + return res; +} + static int get_rand(int min, int max) { 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); #endif char *string_concat(const char *str, ...); char *string_build_path(const char *elem, ...); +char *string_toupper(char *str); char *generate_uuid(); void buffer_read_from_filename(const char *filename, char **buffer, uint64_t *length); -- cgit v1.1-32-gdbae