]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android-sdk/arm-ds5-gator.git/blobdiff - daemon/CapturedXML.cpp
gator-daemon: ARM DS-5.8 Streamline gator daemon (RC1)
[android-sdk/arm-ds5-gator.git] / daemon / CapturedXML.cpp
index 9d9fd846ae7b0e754a74d82b9657d6dc03f16169..5d1f295fdd25394a655e5a093da192bb45723cfa 100644 (file)
@@ -6,8 +6,6 @@
  * published by the Free Software Foundation.
  */
 
-typedef unsigned long long uint64_t;
-typedef long long int64_t;
 #include <stdlib.h>
 #include <string.h>
 #include <dirent.h>
@@ -83,10 +81,10 @@ const char* CapturedXML::getXML() {
 }
 
 void CapturedXML::write(char* path) {
-       char file[PATH_MAX];
+       char* file = (char*)malloc(PATH_MAX);
 
        // Set full path
-       snprintf(file, sizeof(file), "%s/captured.xml", path);
+       snprintf(file, PATH_MAX, "%s/captured.xml", path);
        
        // Write the file
        const char* xml = getXML();
@@ -94,4 +92,6 @@ void CapturedXML::write(char* path) {
                logg->logError(__FILE__, __LINE__, "Error writing %s\nPlease verify the path.", file);
                handleException();
        }
+
+       free(file);
 }