Skip to content
Snippets Groups Projects
Commit 1be93f36 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

fix zero string bug

parent a0689a77
Branches
Tags
No related merge requests found
......@@ -4,7 +4,7 @@
* GL2PS, an OpenGL to PostScript Printing Library
* Copyright (C) 1999-2001 Christophe Geuzaine
*
* $Id: gl2ps.cpp,v 1.31 2001-11-19 10:43:16 geuzaine Exp $
* $Id: gl2ps.cpp,v 1.32 2001-11-19 11:16:44 geuzaine Exp $
*
* E-mail: Christophe.Geuzaine@AdValvas.be
* URL: http://www.geuz.org/gl2ps/
......@@ -1452,7 +1452,6 @@ GLint gl2psEndPage(GLvoid){
GLvoid gl2psText(char *str, char *fontname, GLint fontsize){
GLfloat pos[4];
GL2PSprimitive *prim;
GLint len;
if(gl2ps.options & GL2PS_NO_TEXT) return;
......@@ -1470,12 +1469,8 @@ GLvoid gl2psText(char *str, char *fontname, GLint fontsize){
prim->width = 1;
glGetFloatv(GL_CURRENT_RASTER_COLOR, prim->verts[0].rgba);
prim->text = (GL2PSstring*)gl2psMalloc(sizeof(GL2PSstring));
if((len = strlen(str))){
prim->text->str = (char*)gl2psMalloc((len+1)*sizeof(char));
strcpy(prim->text->str, str);
}
else
prim->text->str = "";
prim->text->str = (char*)gl2psMalloc((strlen(str)+1)*sizeof(char));
strcpy(prim->text->str, str);
prim->text->fontname = fontname;
prim->text->fontsize = fontsize;
gl2psListAdd(gl2ps.primitives, &prim);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment