remove scons build warning from sample app
authorch79.cho <ch79.cho@samsung.com>
Wed, 7 Sep 2016 05:56:42 +0000 (14:56 +0900)
committerUze Choi <uzchoi@samsung.com>
Thu, 8 Sep 2016 07:58:14 +0000 (07:58 +0000)
gets function is changed to input function to remove warining.

Change-Id: I1f2ad5c1962f81a2321597f078baf513a1b83227
Signed-off-by: ch79.cho <ch79.cho@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/11481
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Hun-je Yeon <hunje.yeon@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
service/notification/examples/linux/notificationprovider.c

index 44dae6b..32c4f09 100644 (file)
 #include "cloud_connector.h"
 
 // Input the following values to publish resource to cloud
-char REMOTE_SERVER_ADDRESS[50];
-char AUTH_PROVIDER[50];
-char AUTH_CODE[50];
-char UID[50];
-char ACCESS_TOKEN[50];
+char REMOTE_SERVER_ADDRESS[50] = {'\0',};
+char AUTH_PROVIDER[50] = {'\0',};
+char AUTH_CODE[50] = {'\0',};
+char UID[50] = {'\0',};
+char ACCESS_TOKEN[50] = {'\0',};
 #endif
 
 char mainConsumer[37] = {'\0',};
@@ -318,20 +318,20 @@ int main()
                 break;
 #ifdef WITH_CLOUD
             case 21:
-                printf("Enable Remote Service");
+                printf("Enable Remote Service\n");
                 if(!IsCloudLoggedin())
                 {
-                    printf("Login required");
+                    printf("Login required\n");
                     break;
                 }
-                NSProviderEnableRemoteService(REMOTE_SERVER_ADDRESS);                
+                NSProviderEnableRemoteService(REMOTE_SERVER_ADDRESS);
                 break;
 
             case 22:
-                printf("Disable Remote Service");
+                printf("Disable Remote Service\n");
                 if(!IsCloudLoggedin())
                 {
-                    printf("Login required");
+                    printf("Login required\n");
                     break;
                 }
                 NSProviderDisableRemoteService(REMOTE_SERVER_ADDRESS);
@@ -339,13 +339,13 @@ int main()
 
             case 31:
                 printf("Remote Server Address: ");
-                gets(REMOTE_SERVER_ADDRESS);
+                input(REMOTE_SERVER_ADDRESS);
 
                 printf("Auth Provider(eg. github): ");
-                gets(AUTH_PROVIDER);
+                input(AUTH_PROVIDER);
 
                 printf("Auth Code: ");
-                gets(AUTH_CODE);
+                input(AUTH_CODE);
 
                 OCCloudSignup(REMOTE_SERVER_ADDRESS, OCGetServerInstanceIDString(),
                     AUTH_PROVIDER, AUTH_CODE, CloudSignupCallback);
@@ -353,21 +353,21 @@ int main()
                 break;
             case 32:
                 printf("Remote Server Address: ");
-                gets(REMOTE_SERVER_ADDRESS);
+                input(REMOTE_SERVER_ADDRESS);
 
                 printf("UID: ");
-                gets(UID);
+                input(UID);
 
                 printf("ACCESS_TOKEN: ");
-                gets(ACCESS_TOKEN);
+                input(ACCESS_TOKEN);
 
                 OCCloudLogin(REMOTE_SERVER_ADDRESS, UID, OCGetServerInstanceIDString(),
                     ACCESS_TOKEN, CloudLoginoutCallback);
-                printf("OCCloudLogin requested");
+                printf("OCCloudLogin requested\n");
                 break;
             case 33:
                 OCCloudLogout(REMOTE_SERVER_ADDRESS, CloudLoginoutCallback);
-                printf("OCCloudLogin requested");
+                printf("OCCloudLogin requested\n");
                 break;
 #endif
             case 0: