From: Leon Brocard Date: Sun, 11 Oct 2009 13:55:47 +0000 (+0100) Subject: Fix bug with TTFSizeText, it actually returns 0 on success X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=66877060bc4121d17d7f0487d25bb9f911ee350b;p=sdlgit%2FSDL_perl.git Fix bug with TTFSizeText, it actually returns 0 on success --- diff --git a/src/SDL.xs b/src/SDL.xs index 01c5171..7f30468 100644 --- a/src/SDL.xs +++ b/src/SDL.xs @@ -2930,15 +2930,14 @@ TTFSizeText ( font, text ) RETVAL = newAV(); if(TTF_SizeText(font,text,&w,&h)) { - av_push(RETVAL,newSViv(w)); - av_push(RETVAL,newSViv(h)); - sv_2mortal((SV*)RETVAL); + printf("TTF error at TTFSizeText: %s \n", TTF_GetError()); + Perl_croak (aTHX_ "TTF error \n"); } else { - printf("TTF error at TTFSizeText: %s \n", TTF_GetError()); - Perl_croak (aTHX_ "TTF error \n"); - + av_push(RETVAL,newSViv(w)); + av_push(RETVAL,newSViv(h)); + sv_2mortal((SV*)RETVAL); }