X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=set-address%2Fsetbd.c;h=0fb6b837bd19a1a4ad18580b361591b255f27ee0;hb=e29e186d496d43eb6fa3d625f2d9a1331532d795;hp=013a92f26689f9e031d78ab34a8bc1dc94b1d27e;hpb=836afb4f19a5888434764320b45137b3884d07cd;p=platform%2Fadaptation%2Fbluetooth-firmware-bcm.git diff --git a/set-address/setbd.c b/set-address/setbd.c old mode 100644 new mode 100755 index 013a92f..0fb6b83 --- a/set-address/setbd.c +++ b/set-address/setbd.c @@ -69,10 +69,9 @@ static gboolean is_default_imei=FALSE; #if defined(BT_CHIP_CSR) || defined(BT_CHIP_BROADCOM) int addremoveBD(char* path, char* pskey){ FILE *fd, *new; - int ret; char cmp[READ_BD_FILE_MAX]; char *result; - + int ret; fd = fopen(path, "r"); if(NULL == fd){ APP_DBG("Error open psr file\r\n"); @@ -87,6 +86,8 @@ int addremoveBD(char* path, char* pskey){ } ret = fputs(pskey,new); + if (ret < 0) + return -1; while(1){ result = fgets(cmp, READ_BD_FILE_MAX, fd); @@ -202,10 +203,11 @@ int make_bt_address(gboolean overwrite_bt_address) #if defined(BT_CHIP_CSR) || defined(BT_CHIP_BROADCOM) int fd; - int i; unsigned char txt[BD_ADDR_LEN]; unsigned char nap[4+1], uap[2+1], lap[6+1]; +#if defined(BT_CHIP_CSR) char pskey[PSKEY_LEN+3]; +#endif int ret; fd=open(BD_ADDR_FILE, O_RDONLY | O_SYNC);