Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
freebsd
GitHub Repository: freebsd/freebsd-ports-gnome
Path: blob/main/databases/apq-odbc/files/patch-src_odbc__lib.c
16130 views
1
--- src/odbc_lib.c.orig 2012-01-10 14:17:05.000000000 -0500
2
+++ src/odbc_lib.c
3
@@ -1,3 +1,5 @@
4
+#include <stdlib.h>
5
+#include <string.h>
6
#include "odbc_lib.h"
7
8
9
@@ -43,10 +45,10 @@ void login_Information_Set_Up (ODBC_Logi
10
11
int get_Login_String_Size (ODBC_Login_Information* login_Information) {
12
13
+ int total_Size = 0;
14
if (!is_Ready(login_Information))
15
return(-1);
16
17
- int total_Size = 0;
18
total_Size += strlen(login_Information->p_Formatted_User_Name);
19
total_Size += strlen(login_Information->p_Formatted_Password);
20
total_Size += strlen(login_Information->p_Formatted_Data_Source);
21
@@ -75,6 +77,7 @@ int print_Login_String (ODBC_Login_Infor
22
strcat(destiny, login_Information->p_Formatted_User_Name);
23
strcat(destiny, login_Information->p_Formatted_Password);
24
strcat(destiny, login_Information->p_Formatted_Data_Source);
25
+ return(0);
26
}
27
28
void reset_Login_Information (ODBC_Login_Information* login_Information) {
29
@@ -241,7 +244,7 @@ void connect_With_Data_Source (ODBC_Faca
30
+ 1);
31
32
if (SQL_SUCCEEDED(SQLDriverConnect(odbc_Facade->connection_Handle, NULL,
33
- login_String, SQL_NTS, NULL, 0, NULL,
34
+ (SQLCHAR*)login_String, SQL_NTS, NULL, 0, NULL,
35
SQL_DRIVER_NOPROMPT)))
36
switch_On_Connection(odbc_Facade);
37
38
@@ -273,14 +276,14 @@ ODBC_Query_Results* create_And_Run_SQL_S
39
//TODO: Return error string instead of printing it?
40
void p_Print_Error_Information (ODBC_Facade* odbc_Facade) {
41
42
- char ercode[6];
43
+ SQLCHAR ercode[6];
44
SQLINTEGER err;
45
- char error[250];
46
+ SQLCHAR error[250];
47
SQLSMALLINT size;
48
49
SQLGetDiagRec(SQL_HANDLE_DBC, odbc_Facade->environment_Handle, 1, ercode,
50
&err, error, 250, &size);
51
- printf ("\n%d, %s - %s\n", err, ercode, error);
52
+ printf ("\n%d, %s - %s\n", (int)err, ercode, error);
53
}
54
55
56
@@ -289,4 +292,5 @@ void p_Print_Error_Information (ODBC_Fac
57
char* alloc_String (int size) {
58
char* return_Value = malloc(sizeof(char) * size);
59
*return_Value = '\0';
60
+ return return_Value;
61
}
62
63