MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / int2bstr

Function int2bstr

ut.h:252–268  ·  view source on GitHub ↗

INTeger-TO-Buffer-STRing : converts a 64-bit integer to a string * IMPORTANT: the provided buffer must be at least INT2STR_MAX_LEN size !! */

Source from the content-addressed store, hash-verified

250/* INTeger-TO-Buffer-STRing : converts a 64-bit integer to a string
251 * IMPORTANT: the provided buffer must be at least INT2STR_MAX_LEN size !! */
252static inline char* int2bstr(uint64_t l, char *s, int* len)
253{
254 int i;
255
256 i=INT2STR_MAX_LEN-2;
257 s[INT2STR_MAX_LEN-1]=0; /* null terminate */
258 do{
259 s[i]=l%10+'0';
260 i--;
261 l/=10;
262 }while(l && (i>=0));
263 if (l && (i<0)){
264 LM_CRIT("overflow error\n");
265 }
266 if (len) *len=(INT2STR_MAX_LEN-2)-i;
267 return &s[i+1];
268}
269
270
271/* INTeger-TO-STRing : convers a 64-bit integer to a string

Callers 9

int2strFunction · 0.85
rtpengine_api_copy_opFunction · 0.85
print_content_lengthFunction · 0.85
print_cseq_numFunction · 0.85
dr_load_routing_infoFunction · 0.85
cgr_get_stop_acc_msgFunction · 0.85
cgr_get_cdr_acc_msgFunction · 0.85
env_set_code_statusFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected