Ignore:
Timestamp:
Jul 29, 2006 8:29:24 PM (18 years ago)
Author:
bennylp
Message:

Another take at fixing 64bit problems. PJ_MAX_OBJ_NAME is increased to 32 chars (from 16), and check all those sprintf's especially the ones with "%p" format.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pjproject/trunk/pjlib/src/pj/os_core_linux_kernel.c

    r582 r635  
    139139    thread->terminate = 0; 
    140140 
    141     /* set name of this process (max 15 chars + 0 !) */ 
    142     thread->obj_name[15] = '\0'; 
     141    /* set name of this process (making sure obj_name is null  
     142     * terminated first)  
     143     */ 
     144    thread->obj_name[PJ_MAX_OBJ_NAME-1] = '\0'; 
    143145    sprintf(current->comm, thread->obj_name); 
    144146         
     
    267269        pj_sprintf(thread->obj_name, cstr_thread_name, thread->thread); 
    268270    else 
    269         pj_sprintf(thread->obj_name, "thr%p", (void*)thread->thread); 
     271        pj_snprintf(thread->obj_name, sizeof(thread->obj_name),  
     272                    "thr%p", (void*)thread->thread); 
    270273     
    271274    /* Initialize. */ 
Note: See TracChangeset for help on using the changeset viewer.