Skip to content

Commit b8c99bb

Browse files
ancientwizarddjzort
authored andcommitted
Just in case #59 is right
and someting is marginal. I didn't see the warnings and unable to locate a test that triggerd the use of this code path.
1 parent 4806c0f commit b8c99bb

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

oci8.c

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2340,10 +2340,9 @@ static void get_attr_val(SV *sth,AV *list,imp_fbh_t *fbh, text *name , OCITypeC
23402340
&ub4_str_len,
23412341
str_buf,
23422342
status);
2343-
23442343
if (typecode == OCI_TYPECODE_TIMESTAMP_TZ || typecode == OCI_TYPECODE_TIMESTAMP_LTZ){
2345-
char s_tz_hour[6]="000";
2346-
char s_tz_min[6]="000";
2344+
char s_tz_hour[8]="000";
2345+
char s_tz_min[8]="000";
23472346
sb1 tz_hour;
23482347
sb1 tz_minute;
23492348
status = OCIDateTimeGetTimeZoneOffset (fbh->imp_sth->envhp,
@@ -2353,12 +2352,12 @@ static void get_attr_val(SV *sth,AV *list,imp_fbh_t *fbh, text *name , OCITypeC
23532352
&tz_minute );
23542353

23552354
if ( (tz_hour<0) && (tz_hour>-10) ){
2356-
sprintf(s_tz_hour," %03d",tz_hour);
2355+
snprintf(s_tz_hour,sizeof(s_tz_hour)," %03d",tz_hour);
23572356
} else {
2358-
sprintf(s_tz_hour," %02d",tz_hour);
2357+
snprintf(s_tz_hour,sizeof(s_tz_hour)," %02d",tz_hour);
23592358
}
23602359

2361-
sprintf(s_tz_min,":%02d", tz_minute);
2360+
snprintf(s_tz_min,sizeof(s_tz_min),":%02d", tz_minute);
23622361
strcat((signed char*)str_buf, s_tz_hour);
23632362
strcat((signed char*)str_buf, s_tz_min);
23642363
str_buf[ub4_str_len+7] = '\0';

0 commit comments

Comments
 (0)