Changeset db28e6c in pugl


Ignore:
Timestamp:
11/11/15 14:59:31 (22 months ago)
Author:
David Robillard <d@…>
Branches:
master
Children:
0f48a69
Parents:
95a42df
Message:

Avoid use of strdup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • pugl/pugl_internal.h

    r95a42df rdb28e6c  
    2828   PUGL_HAVE_GL:    Include OpenGL support code. 
    2929*/ 
     30 
     31#include <stdlib.h> 
     32#include <string.h> 
    3033 
    3134#include "pugl/pugl.h" 
     
    121124puglInitWindowClass(PuglView* view, const char* name) 
    122125{ 
     126    const size_t len = strlen(name); 
     127 
    123128    free(view->windowClass); 
    124     view->windowClass = strdup(name); 
     129    view->windowClass = (char*)calloc(1, len + 1); 
     130    memcpy(view->windowClass, name, len); 
    125131} 
    126132 
Note: See TracChangeset for help on using the changeset viewer.