summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Kocialkowski <contact@paulk.fr>2013-02-08 22:35:03 +0100
committerPaul Kocialkowski <contact@paulk.fr>2013-02-08 22:35:03 +0100
commit7bd54b9cea1e094381a1c3aa7def890de37adbd4 (patch)
treeed83983048137ec6c88bd2edb37145efaa4276e3
parent792c4f41ffbee7455fe227159012131d3605552f (diff)
downloadhardware_ril_samsung-ril-7bd54b9cea1e094381a1c3aa7def890de37adbd4.zip
hardware_ril_samsung-ril-7bd54b9cea1e094381a1c3aa7def890de37adbd4.tar.gz
hardware_ril_samsung-ril-7bd54b9cea1e094381a1c3aa7def890de37adbd4.tar.bz2
MISC: Timezone can be negative: handle that case as well
Signed-off-by: Paul Kocialkowski <contact@paulk.fr>
-rw-r--r--misc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/misc.c b/misc.c
index 035a061..6c06e54 100644
--- a/misc.c
+++ b/misc.c
@@ -236,9 +236,10 @@ void ipc_misc_time_info(struct ipc_message_info *info)
struct ipc_misc_time_info *nitz = (struct ipc_misc_time_info*) info->data;
char str[128];
- sprintf(str, "%02u/%02u/%02u,%02u:%02u:%02u+%02d,%02d",
+ sprintf(str, "%02u/%02u/%02u,%02u:%02u:%02u%c%02d,%02d",
nitz->year, nitz->mon, nitz->day, nitz->hour,
- nitz->min, nitz->sec, nitz->tz, 0);
+ nitz->min, nitz->sec, nitz->tz < 0 ? '-' : '+',
+ nitz->tz < 0 ? -nitz->tz : nitz->tz, 0);
ril_request_unsolicited(RIL_UNSOL_NITZ_TIME_RECEIVED,
str, strlen(str) + 1);