Changeset 107 in libcf for trunk/src/cf_debug.c


Ignore:
Timestamp:
05/30/13 16:57:55 (11 years ago)
Author:
cheese
Message:

#1 change sprintf to snprintf and imporve performance of log

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/cf_debug.c

    r87 r107  
    225225
    226226    /* push to callstack */
    227     sprintf (push->file, "%s", file);
    228     sprintf (push->func, "%s", func);
     227    snprintf (push->file, NAME_LENGTH, "%s", file);
     228    snprintf (push->func, NAME_LENGTH, "%s", func);
    229229    push->line = line;
    230230    push->caller = context->callstack.caller;
     
    260260    if (callstack != NULL)
    261261    {
    262         sprintf (callstack->file    , "%s", pop->file);
    263         sprintf (callstack->function, "%s", pop->func);
     262        snprintf (callstack->file    , NAME_LENGTH, "%s", pop->file);
     263        snprintf (callstack->function, NAME_LENGTH, "%s", pop->func);
    264264        callstack->line = pop->line;
    265265    }
Note: See TracChangeset for help on using the changeset viewer.