Merge branch 'master' into tizen_2.1
[apps/native/ug-wifi-direct.git] / popup-wifidirect / src / wfd-app-util.c
index d584917..4e77cc2 100644 (file)
@@ -1,13 +1,13 @@
 /*
 *  WiFi-Direct UG
 *
-* Copyright 2012  Samsung Electronics Co., Ltd
+* Copyright 2012 Samsung Electronics Co., Ltd
 
-* Licensed under the Flora License, Version 1.0 (the "License");
+* Licensed under the Flora License, Version 1.1 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 
-* http://www.tizenopensource.org/license
+* http://floralicense.org/license
 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 char *wfd_app_trim_path(const char *filewithpath)
 {
 #if 0
-    char *filename = NULL;
-    if ((filename = strrchr(filewithpath, '/')) == NULL)
-        return (char *) filewithpath;
-    else
-        return (filename + 1);
+       char *filename = NULL;
+       if ((filename = strrchr(filewithpath, '/')) == NULL)
+           return (char *) filewithpath;
+       else
+           return (filename + 1);
 #else
-    static char *filename[100];
-    char *strptr = NULL;
-    int start = 0;
-    const char *space = "                                        ";
-    int len = strlen(filewithpath);
+       static char *filename[100];
+       char *strptr = NULL;
+       int start = 0;
+       const char *space = "                                        ";
+       int len = strlen(filewithpath);
 
-    if (len > 20)
-    {
-        strptr = (char *) filewithpath + (len - 20);
-        start = 0;
-    }
-    else if (len < 20)
-    {
-        strptr = (char *) filewithpath;
-        start = 20 - len;
-    }
-    strncpy((char *) filename, space, strlen(space));
-    strncpy((char *) filename + start, strptr, 50);
+       if (len > 20) {
+               strptr = (char *) filewithpath + (len - 20);
+               start = 0;
+       } else if (len < 20) {
+               strptr = (char *) filewithpath;
+               start = 20 - len;
+       }
 
-    return (char *) filename;
+       strncpy((char *) filename, space, strlen(space));
+       strncpy((char *) filename + start, strptr, 50);
+
+       return (char *) filename;
 #endif
 }
 
@@ -67,10 +65,9 @@ char *wfd_app_trim_path(const char *filewithpath)
 int wfd_app_gettid()
 {
 #ifdef __NR_gettid
-    return syscall(__NR_gettid);
+       return syscall(__NR_gettid);
 #else
-    fprintf(stderr,
-            "__NR_gettid is not defined, please include linux/unistd.h ");
-    return -1;
+       fprintf(stderr, "__NR_gettid is not defined, please include linux/unistd.h ");
+       return -1;
 #endif
 }