Skip to content

Commit

Permalink
Use new API
Browse files Browse the repository at this point in the history
  • Loading branch information
Nickid2018 committed Sep 14, 2024
1 parent d4d5e2d commit 1eda314
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,14 +38,15 @@ jobs:
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
with:
vs-version: 16.4
msbuild-architecture: x64
- name: Make build dir
run: mkdir build
working-directory: wireshark
- name: Configure Wireshark
run: cmake -A x64 .. -DBUILD_wireshark=OFF
working-directory: wireshark/build
- run: cmake --build . --config RelWithDebInfo --target epan
- name: Build Wireshark
run: cmake --build . --config RelWithDebInfo --target epan
working-directory: wireshark/build
- name: Configure dissector (Debug)
if: "!startsWith(github.ref, 'refs/tags/') || contains(github.ref, 'beta')"
Expand Down
2 changes: 1 addition & 1 deletion mc_dissector.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ gchar *pref_protocol_data_dir;
module_t *pref_mcje = NULL;
gchar *pref_ignore_packets_je = "c:map_chunk";
gchar *pref_secret_key = "";
gboolean pref_do_nbt_decode = false;
bool pref_do_nbt_decode = false;

module_t *pref_mcbe = NULL;

Expand Down
2 changes: 1 addition & 1 deletion mc_dissector.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ extern int proto_mcbe;
extern module_t *pref_mcje;
extern gchar *pref_ignore_packets_je;
extern gchar *pref_secret_key;
extern gboolean pref_do_nbt_decode;
extern bool pref_do_nbt_decode;

extern module_t *pref_mcbe;

Expand Down
6 changes: 3 additions & 3 deletions protocol/protocol_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ gint read_var_int(tvbuff_t *tvb, gint offset, gint *result) {
do {
if (p == 5)
return INVALID_DATA;
read = tvb_get_guint8(tvb, offset + p);
read = tvb_get_uint8(tvb, offset + p);
*result |= (read & 0x7F) << (7 * p++);
} while ((read & 0x80) != 0);
return p;
Expand All @@ -26,7 +26,7 @@ gint read_var_int_with_limit(tvbuff_t *tvb, gint offset, gint max_length, gint *
do {
if (p == 5 || p >= max_length)
return INVALID_DATA;
read = tvb_get_guint8(tvb, offset + p);
read = tvb_get_uint8(tvb, offset + p);
*result |= (read & 0x7F) << (7 * p++);
} while ((read & 0x80) != 0);
return p;
Expand All @@ -39,7 +39,7 @@ gint read_var_long(tvbuff_t *tvb, gint offset, gint64 *result) {
do {
if (p == 10)
return INVALID_DATA;
read = tvb_get_guint8(tvb, offset + p);
read = tvb_get_uint8(tvb, offset + p);
*result |= (read & 0x7F) << (7 * p++);
} while ((read & 0x80) != 0);
return p;
Expand Down

0 comments on commit 1eda314

Please sign in to comment.