Skip to content

Commit

Permalink
[1] Fixing bitwise manips
Browse files Browse the repository at this point in the history
[2] Removing sample app from build script because it now works properly.
  • Loading branch information
lyndonbauto committed Jul 6, 2021
1 parent 0fdc611 commit 52884fc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/linux-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,12 @@ jobs:
cd ..
- name: build-deb-installer
if: success()
# TODO: Remove deb install. Temporarily adding so I can test sample application
run: |
./build_linux_release64_deb.sh
cd cmake-build64
cmake ../src
make -j4
cpack .
sudo dpkg -i amazontimestreamodbcdriver64-bit0.3.2_0.3.2_amd64.deb
cd ..
- name: create-output
if: success()
Expand Down Expand Up @@ -156,7 +154,6 @@ jobs:
cd build
cmake ../ -DCMAKE_BUILD_TYPE=Release
make -j 4
./ODBCcli "DSN=timestream-aws-profile" "SELECT * FROM ODBCTest.IoT LIMIT 1"
build-linux32:
runs-on: ubuntu-latest
steps:
Expand Down
14 changes: 7 additions & 7 deletions src/odfesqlodbc/win_unicode.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ char *ucs2_to_utf8(const SQLWCHAR *ucs2str, SQLLEN ilen, SQLLEN *olen,
memcpy(utf8str + len, (char *)&byte2code,
sizeof(byte2code));
else {
utf8str[len] = (char)((byte2code >> 8) && 0xFF);
utf8str[len] = (char)((byte2code >> 8) & 0xFF);
utf8str[len + 1] = (char)(byte2code & 0xFF);
}
len += sizeof(byte2code);
Expand All @@ -184,9 +184,9 @@ char *ucs2_to_utf8(const SQLWCHAR *ucs2str, SQLLEN ilen, SQLLEN *olen,
memcpy(utf8str + len, (char *)&byte4code,
sizeof(byte4code));
else {
utf8str[len] = (char)((byte4code >> 24) && 0xFF);
utf8str[len + 1] = (char)((byte4code >> 16) && 0xFF);
utf8str[len + 2] = (char)((byte4code >> 8) && 0xFF);
utf8str[len] = (char)((byte4code >> 24) & 0xFF);
utf8str[len + 1] = (char)((byte4code >> 16) & 0xFF);
utf8str[len + 2] = (char)((byte4code >> 8) & 0xFF);
utf8str[len + 3] = (char)(byte4code & 0xFF);
}
len += sizeof(byte4code);
Expand All @@ -197,9 +197,9 @@ char *ucs2_to_utf8(const SQLWCHAR *ucs2str, SQLLEN ilen, SQLLEN *olen,
if (little_endian)
memcpy(utf8str + len, (char *)&byte4code, 3);
else {
utf8str[len] = (char)((byte4code >> 16) && 0xFF);
utf8str[len + 1] = (char)((byte4code >> 8) && 0xFF);
utf8str[len + 2] = (char)((byte4code) && 0xFF);
utf8str[len] = (char)((byte4code >> 16) & 0xFF);
utf8str[len + 1] = (char)((byte4code >> 8) & 0xFF);
utf8str[len + 2] = (char)((byte4code) & 0xFF);
}
len += 3;
}
Expand Down

0 comments on commit 52884fc

Please sign in to comment.