aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2019-03-17 15:15:22 -0700
committerGuy Harris <guy@alum.mit.edu>2019-03-17 22:15:57 +0000
commit5a7e0b63502704882171c8292bc4d70a442cc6d0 (patch)
tree4e636cf870b5ec03a4e48389ead92272b15c3ef3
parentc40e18b252c11e124d31277974f1de5d6561d951 (diff)
Don't cast away constness if you don't have to.
Change-Id: Ib6bf70c8d222d1c31681535689d2372178df3b80 Reviewed-on: https://code.wireshark.org/review/32463 Reviewed-by: Guy Harris <guy@alum.mit.edu>
-rw-r--r--extcap/sdjournal.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/extcap/sdjournal.c b/extcap/sdjournal.c
index ecc6cb52a5..cca467c7f4 100644
--- a/extcap/sdjournal.c
+++ b/extcap/sdjournal.c
@@ -144,7 +144,7 @@ static int sdj_dump_entries(sd_journal *jnl, FILE* fp)
g_debug("Breaking on binary field: %u + %zd", data_end, fld_len);
break;
}
- ptrdiff_t name_len = eq_ptr - (guint8 *) fld_data;
+ ptrdiff_t name_len = eq_ptr - (const guint8 *) fld_data;
uint64_t le_data_len;
le_data_len = htole64(fld_len - name_len - 1);
memcpy(entry_buff+data_end, fld_data, name_len);
@@ -153,7 +153,7 @@ static int sdj_dump_entries(sd_journal *jnl, FILE* fp)
data_end++;
memcpy(entry_buff+data_end, &le_data_len, 8);
data_end += 8;
- memcpy(entry_buff+data_end, (guint8 *) fld_data + name_len + 1, fld_len - name_len);
+ memcpy(entry_buff+data_end, (const guint8 *) fld_data + name_len + 1, fld_len - name_len);
data_end += fld_len - name_len;
}
}