]> granicus.if.org Git - php/commitdiff
Use size_t instead of int, use more specific format string
authorAdam Baratz <adambaratz@php.net>
Tue, 31 Oct 2017 20:43:26 +0000 (16:43 -0400)
committerAdam Baratz <adambaratz@php.net>
Tue, 31 Oct 2017 20:43:35 +0000 (16:43 -0400)
ext/pdo_dblib/dblib_stmt.c

index 469bd790de6225b394ae7f7e11d2ef9b552251b4..2cebe982e41ba1f023fc0ffd0d81605a449b7240 100644 (file)
@@ -330,14 +330,14 @@ static int pdo_dblib_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr,
                                }
                                case SQLDATETIME:
                                case SQLDATETIM4: {
-                                       int dl;
+                                       size_t dl;
                                        DBDATEREC di;
                                        DBDATEREC dt;
 
                                        dbconvert(H->link, coltype, data, -1, SQLDATETIME, (LPBYTE) &dt, -1);
                                        dbdatecrack(H->link, &di, (DBDATETIME *) &dt);
 
-                                       dl = spprintf(&tmp_data, 20, "%d-%02d-%02d %02d:%02d:%02d",
+                                       dl = spprintf(&tmp_data, 20, "%04d-%02d-%02d %02d:%02d:%02d",
 #if defined(PHP_DBLIB_IS_MSSQL) || defined(MSDBLIB)
                                                        di.year,     di.month,       di.day,        di.hour,     di.minute,     di.second
 #else