Skip to content

Commit d7548b0

Browse files
chore: change ato... to strto... (#117)
1 parent f7fccb5 commit d7548b0

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

connection.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1264,7 +1264,7 @@ TokenResult GetTokenForIAM(ConnInfo* ci, BOOL useCache) {
12641264
return TR_FAILURE;
12651265
}
12661266

1267-
int port = atoi(ci->port);
1267+
int port = pg_atoi(ci->port);
12681268
if (port < 1) {
12691269
port = 5432; // set to default port.
12701270
}
@@ -1323,7 +1323,7 @@ bool GetLimitlessServer(ConnInfo *ci, const char **limitless_err) {
13231323
return true;
13241324
}
13251325

1326-
int host_port = atoi(ci->port);
1326+
int host_port = pg_atoi(ci->port);
13271327
ci->limitless_enabled = 0;
13281328
char connect_string_encoded[MAX_CONNECT_STRING];
13291329
makeConnectString(connect_string_encoded, ci, MAX_CONNECT_STRING);

dlg_specific.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -730,19 +730,19 @@ copyConnAttributes(ConnInfo *ci, const char *attribute, const char *value)
730730
else if (stricmp(attribute, INI_SECRET_ID) == 0)
731731
STRCPY_FIXED(ci->secret_id, value);
732732
else if (stricmp(attribute, INI_LIMITLESS_ENABLED) == 0)
733-
ci->limitless_enabled = atoi(value);
733+
ci->limitless_enabled = pg_atoi(value);
734734
else if (stricmp(attribute, INI_LIMITLESS_MODE) == 0)
735735
STRCPY_FIXED(ci->limitless_mode, value);
736736
else if (stricmp(attribute, INI_LIMITLESS_MONITOR_INTERVAL_MS) == 0)
737-
ci->limitless_monitor_interval_ms = atoi(value);
737+
ci->limitless_monitor_interval_ms = pg_atoi(value);
738738
else if (stricmp(attribute, INI_LIMITLESS_SERVICE_ID) == 0)
739739
STRCPY_FIXED(ci->limitless_service_id, value);
740740
else if (stricmp(attribute, INI_LOGDIR) == 0)
741741
STRCPY_FIXED(ci->log_dir, value);
742742
else if (stricmp(attribute, INI_RDSLOGGINGENABLED) == 0)
743-
ci->rds_logging_enabled = atoi(value);
743+
ci->rds_logging_enabled = pg_atoi(value);
744744
else if (stricmp(attribute, INI_RDSLOGTHRESHOLD) == 0)
745-
ci->rds_log_threshold = atoi(value);
745+
ci->rds_log_threshold = pg_atoi(value);
746746
else if (stricmp(attribute, INI_READONLY) == 0 || stricmp(attribute, ABBR_READONLY) == 0)
747747
STRCPY_FIXED(ci->onlyread, value);
748748
else if (stricmp(attribute, INI_PROTOCOL) == 0 || stricmp(attribute, ABBR_PROTOCOL) == 0)
@@ -1336,21 +1336,21 @@ MYLOG(MIN_LOG_LEVEL, "drivername=%s\n", drivername);
13361336
if (SQLGetPrivateProfileString(DSN, INI_CLUSTER_ID, NULL_STRING, temp, sizeof(temp), ODBC_INI) > 0)
13371337
STRCPY_FIXED(ci->cluster_id, temp);
13381338
if (SQLGetPrivateProfileString(DSN, INI_ENABLE_CLUSTER_FAILOVER, NULL_STRING, temp, sizeof(temp), ODBC_INI) > 0)
1339-
ci->enable_failover = atoi(temp);
1339+
ci->enable_failover = pg_atoi(temp);
13401340
if (SQLGetPrivateProfileString(DSN, INI_FAILOVER_MODE, NULL_STRING, temp, sizeof(temp), ODBC_INI) > 0)
13411341
STRCPY_FIXED(ci->failover_mode, temp);
13421342
if (SQLGetPrivateProfileString(DSN, INI_FAILOVER_TIMEOUT, NULL_STRING, temp, sizeof(temp), ODBC_INI) > 0)
1343-
ci->failover_timeout = atoi(temp);
1343+
ci->failover_timeout = pg_atoi(temp);
13441344
if (SQLGetPrivateProfileString(DSN, INI_HOST_PATTERN, NULL_STRING, temp, sizeof(temp), ODBC_INI) > 0)
13451345
STRCPY_FIXED(ci->host_pattern, temp);
13461346
if (SQLGetPrivateProfileString(DSN, INI_IGNORE_TOPOLOGY_REQUEST_RATE, NULL_STRING, temp, sizeof(temp), ODBC_INI) > 0)
1347-
ci->ignore_topology_refresh = atoi(temp);
1347+
ci->ignore_topology_refresh = pg_atoi(temp);
13481348
if (SQLGetPrivateProfileString(DSN, INI_READER_STRATEGY, NULL_STRING, temp, sizeof(temp), ODBC_INI) > 0)
13491349
STRCPY_FIXED(ci->reader_host_selector_strategy, temp);
13501350
if (SQLGetPrivateProfileString(DSN, INI_TOPOLOGY_HIGH_REFRESH_RATE, NULL_STRING, temp, sizeof(temp), ODBC_INI) > 0)
1351-
ci->topology_high_refresh = atoi(temp);
1351+
ci->topology_high_refresh = pg_atoi(temp);
13521352
if (SQLGetPrivateProfileString(DSN, INI_TOPOLOGY_REFRESH_RATE, NULL_STRING, temp, sizeof(temp), ODBC_INI) > 0)
1353-
ci->topology_refresh = atoi(temp);
1353+
ci->topology_refresh = pg_atoi(temp);
13541354

13551355
/* Allow override of odbcinst.ini parameters here */
13561356
get_Ci_Drivers(DSN, ODBC_INI, &(ci->drivers));

0 commit comments

Comments
 (0)