[Bugfix][T106BUG-271]when using demo input error num,will endless loop
Only Configure:No
Affected branch:master
Affected module:gnss-demo
Is it affected on both ZXIC and MTK:only ZXIC
Self-test:Yes
Doc Update:NO
Change-Id: Ic6ea260db901f5973ad85fff6c9b698b9d50fbc4
diff --git a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-gnss-demo/files/lynq-qser-gnss-demo.cpp b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-gnss-demo/files/lynq-qser-gnss-demo.cpp
index d3d8e89..c8fcda2 100755
--- a/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-gnss-demo/files/lynq-qser-gnss-demo.cpp
+++ b/cap/zx297520v3/sources/meta-zxic-custom/recipes-lynq/lynq-qser-gnss-demo/files/lynq-qser-gnss-demo.cpp
@@ -49,6 +49,7 @@
printf("=========gnss main=========\n");
user_help();
scanf("%d", &opt);
+ while(getchar()!='\n');
switch (opt)
{
case -1:
@@ -157,6 +158,7 @@
printf("=========delete aiding data type=========\n");
delete_type();
scanf("%d", &opt_1);
+ while(getchar()!='\n');
switch(opt_1)
{
case 0:
@@ -189,6 +191,11 @@
ptr = DELETE_ALL;//cold
break;
}
+ default:
+ {
+ printf("input error\n");
+ return -1;
+ }
}
ret = qser_Gnss_Delete_Aiding_Data(ph_gnss,ptr);
if(ret < 0)
@@ -267,6 +274,11 @@
printf("qser_Gnss_Server_Configuration ssuccess\n");
break;
}
+ default:
+ {
+ printf("input error,please re-enter\n");
+ break;
+ }
}
}
return 0;