c - value of a local variable changes in its own scope -


 void my_initm3uaparamprot_data(char *prefix, m3uaparamprotocoldata *param, pointcode opc, pointcode dpc, unsigned char si, unsigned char ni, unsigned char mp, unsigned char sls, void *buf, unsigned short size) {     unsigned short len, pc_len;     char tempbuf[500];   len = m3ua_param_header_len + 2 * pc_size + 4 + size; //4 size of si+ni+mp+sls  logactivity(__function__, "nayan_log", e_notice, "len: %d", len);  memset(param, meminit_value, sizeof(m3uaparamprotocoldata)); param->h.tag = htons(pprot_data); param->h.len = htons(len);  memcpy(&param->opc, &opc, pc_size); memcpy(&param->dpc, &dpc, pc_size); param->si = si; param->ni = ni; param->mp = mp; param->sls = sls; memcpy(param->buf, buf, size);   memset(tempbuf, 0, sizeof(tempbuf)); (int l = 0; l < len; l++)     sprintf(tempbuf, "%s %0x", tempbuf, param->buf[l]);  logactivity(__function__, "nayan_log", e_notice, "buf:  %s len: %d", tempbuf, len);  /*logactivity("", "kero_hoise", e_debug_major, "%s encoded_len = %d shifting_bits = %d", tempbuf, resultsize, shifting_bits);*/ 

}

if call function size = smaller value works when call function size > 190 different values len @ line 3 , 7. if make variable static len has same value in lines. can't understand why happening.


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -