Re: Check return of function

2020-08-21 Thread Kleber Tarcísio
Thanks for the feedback. Kleber Em sexta-feira, 21 de agosto de 2020 01:22:36 BRT, Werner LEMBERG escreveu: >> Today the code is like this: >> >>    error = FT_New_Size( t42face->ttf_face, ); >>    t42size->ttsize = ttsize; >>    FT_Activate_Size( ttsize ); >> >>  My initial

Re: Check return of function

2020-08-20 Thread Werner LEMBERG
>> Today the code is like this: >> >> error = FT_New_Size( t42face->ttf_face, ); >> t42size->ttsize = ttsize; >> FT_Activate_Size( ttsize ); >> >> My initial suggestion was: >> >> error = FT_New_Size( t42face->ttf_face, ); >> if(error) >> return error; >>

Re: Check return of function

2020-08-20 Thread Kleber Tarcísio
Hi Alexei, I'm not expert in this system, but I think that it is not a good pratice. Sorry if i caused any misunderstanding. Kleber Em quinta-feira, 20 de agosto de 2020 16:43:47 BRT, Alexei Podtelezhnikov escreveu: Kleber, Why would you prefer uninitialized t42size->ttsize to NULL?

Re: Check return of function

2020-08-20 Thread Alexei Podtelezhnikov
Kleber, Why would you prefer uninitialized t42size->ttsize to NULL? Please answer this question. Alexei On Thu, Aug 20, 2020 at 3:20 PM Kleber Tarcísio wrote: > > Hi everyone, > > I appreciate your attention! > > Today the code is like this: > > error = FT_New_Size( t42face->ttf_face,

Re: Check return of function

2020-08-20 Thread Kleber Tarcísio
Hi everyone, I appreciate your attention! Today the code is like this:    error = FT_New_Size( t42face->ttf_face, );    t42size->ttsize = ttsize;    FT_Activate_Size( ttsize );  My initial suggestion was:     error = FT_New_Size( t42face->ttf_face, );    if(error)    return error;

Re: Check return of function

2020-08-20 Thread Alexei Podtelezhnikov
> In the first case, I think we need return because ttsize can be NULL and > t42size->ttsize = ttsize; could get a NULL value.Is it a problem, no? > In the first case, I think we need return because ttslot can be NULL and > slot-> ttslot = ttslot; could get a NULL value.Is it a problem, no?

Re: Check return of function

2020-08-20 Thread Alexei Podtelezhnikov
Hi Kleber, > https://github.com/klebertarcisio/freetype2-1/commit/aab3c841f08c3a67914fbd0167ef4ff174116ccf What is wrong with a couple of housekeeping lines before returning the error? Why do you think that it is necessary to drop everything and run for cover? In fact, libraries are not supposed

Check return of function

2020-08-20 Thread Kleber Tarcísio
Hi Free Type Team, how are you? My name is Kleber and I'm a PhD student. I'm working on a technique to help developers to find weaknesses in configurable systems. I would like to know what you think about this change: