From ab1813a4454cbe639e99eaee7cd1115bfed1cf8f Mon Sep 17 00:00:00 2001 From: Miika Turkia Date: Sun, 7 May 2017 09:41:27 +0300 Subject: Move intdup to qthelper Signed-off-by: Miika Turkia --- core/qthelper.cpp | 9 +++++++++ core/qthelper.h | 1 + 2 files changed, 10 insertions(+) (limited to 'core') diff --git a/core/qthelper.cpp b/core/qthelper.cpp index 79fc0effc..993ecbf7d 100644 --- a/core/qthelper.cpp +++ b/core/qthelper.cpp @@ -1509,3 +1509,12 @@ QString getUUID() uuidString.replace("{", "").replace("}", ""); return uuidString; } + +char *intdup(int index) +{ + char tmpbuf[21]; + + snprintf(tmpbuf, sizeof(tmpbuf) - 2, "%d", index); + tmpbuf[20] = 0; + return strdup(tmpbuf); +} diff --git a/core/qthelper.h b/core/qthelper.h index 9788bb55d..a85294963 100644 --- a/core/qthelper.h +++ b/core/qthelper.h @@ -46,5 +46,6 @@ extern "C" enum deco_mode decoMode(); extern "C" void subsurface_mkdir(const char *dir); void init_proxy(); QString getUUID(); +char *intdup(int index); #endif // QTHELPER_H -- cgit v1.2.3-70-g09d2