Hi Jeevaka,
>-----Original Message----- >From: [email protected] [mailto:[email protected]] On Behalf Of >[email protected] >Sent: Wednesday, December 01, 2010 4:43 AM >To: [email protected] >Subject: RE: [PATCH 3/3] stk: Handle provide local info proactive command > > >Hi Yang, > >> >> +static void get_time(struct stk_response *rsp) { >> + time_t now; >> + struct tm *t; >> + >> + time(&now); >> + t = localtime(&now); >> + >> + rsp->result.type = STK_RESULT_TYPE_SUCCESS; >> + >> + if (t->tm_year > 100) >> + rsp->provide_local_info.datetime.year = >> t->tm_year - 100; >> + else >> + rsp->provide_local_info.datetime.year = t->tm_year; >> + > >Incase of error, localtime shall return a null pointer. I think its >better to add the NULL check. Thanks for the comment. I have sent out the modified version. Regards, -Yang _______________________________________________ ofono mailing list [email protected] http://lists.ofono.org/listinfo/ofono
