summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrediano Ziglio <fziglio@redhat.com>2015-08-25 08:58:53 +0100
committerFrediano Ziglio <fziglio@redhat.com>2015-08-25 10:50:18 +0100
commitf01c462031890b5d4e26e0d870f67fac8a929a18 (patch)
tree641c5570ecd20f62e396eb695f4216fc310b6f25
parenta9e34bd27ab8e4394a0852806f0bab00eabb79e6 (diff)
replay: fix check for QXL_SURF_FLAG_KEEP_DATA flag
A logical and (&&) was used instead of a bit one (&). Was working just as is the only flag defined. Signed-off-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Fabiano Fidencio <ffidenci@redhat.com>
-rw-r--r--server/red_record_qxl.c2
-rw-r--r--server/red_replay_qxl.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/server/red_record_qxl.c b/server/red_record_qxl.c
index d96fb79..b35b462 100644
--- a/server/red_record_qxl.c
+++ b/server/red_record_qxl.c
@@ -724,7 +724,7 @@ static void red_record_surface_cmd(FILE *fd, RedMemSlotInfo *slots, int group_id
fprintf(fd, "u.surface_create.height %d\n", qxl->u.surface_create.height);
fprintf(fd, "u.surface_create.stride %d\n", qxl->u.surface_create.stride);
size = qxl->u.surface_create.height * abs(qxl->u.surface_create.stride);
- if (qxl->flags && QXL_SURF_FLAG_KEEP_DATA) {
+ if ((qxl->flags & QXL_SURF_FLAG_KEEP_DATA) != 0) {
write_binary(fd, "data", size,
(uint8_t*)get_virt(slots, qxl->u.surface_create.data, size, group_id,
&error));
diff --git a/server/red_replay_qxl.c b/server/red_replay_qxl.c
index a010a58..5044adf 100644
--- a/server/red_replay_qxl.c
+++ b/server/red_replay_qxl.c
@@ -1025,7 +1025,7 @@ static QXLSurfaceCmd *red_replay_surface_cmd(SpiceReplay *replay)
replay_fscanf(replay, "u.surface_create.height %d\n", &qxl->u.surface_create.height);
replay_fscanf(replay, "u.surface_create.stride %d\n", &qxl->u.surface_create.stride);
size = qxl->u.surface_create.height * abs(qxl->u.surface_create.stride);
- if (qxl->flags && QXL_SURF_FLAG_KEEP_DATA) {
+ if ((qxl->flags & QXL_SURF_FLAG_KEEP_DATA) != 0) {
read_binary(replay, "data", &read_size, (uint8_t**)&qxl->u.surface_create.data, 0);
if (read_size != size) {
spice_printerr("mismatch %ld != %ld", size, read_size);