[gnome-sudoku/qqwing-version] Simplify qqwing_get_version()



commit afa1e0efc0d9d0726a6fbceb0e3c5884933da216
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Wed Aug 6 19:13:09 2014 -0500

    Simplify qqwing_get_version()
    
    C++ makes me feel like not a GNOME programmer at all.

 lib/qqwing-wrapper.cpp |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
---
diff --git a/lib/qqwing-wrapper.cpp b/lib/qqwing-wrapper.cpp
index 7118521..9136f64 100644
--- a/lib/qqwing-wrapper.cpp
+++ b/lib/qqwing-wrapper.cpp
@@ -83,8 +83,5 @@ void qqwing_print_stats(int* puzzle)
  */
 char* qqwing_get_version()
 {
-    string version = getVersion();
-    char* copy = static_cast<char*>(g_malloc(version.length() + 1)); // +1 for the trailing nullptr
-    strcpy(copy, version.c_str());
-    return copy;
+    return g_strdup(getVersion().c_str());
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]