Changeset db28e6c in pugl


Ignore:
Timestamp:
Nov 11, 2015, 2:59:31 PM (2 years 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.