diff options
author | Hans de Goede <hdegoede@redhat.com> | 2013-03-14 17:06:22 +0100 |
---|---|---|
committer | Hans de Goede <hdegoede@redhat.com> | 2013-03-15 09:44:26 +0100 |
commit | 3a2f42555dbae4357aa9fc2e83c9b31a837ac98d (patch) | |
tree | b7aff16ca358c280a16225fba0e1f9d1129bff6b /server/reds.c | |
parent | 89d2a68cb7bfa105d27d12497a1f4e340171b525 (diff) | |
download | spice-3a2f42555dbae4357aa9fc2e83c9b31a837ac98d.tar.gz spice-3a2f42555dbae4357aa9fc2e83c9b31a837ac98d.tar.xz spice-3a2f42555dbae4357aa9fc2e83c9b31a837ac98d.zip |
main-channel: Make main_channel_push_notify deal with dynamic memory
Currently main_channel_push_notify only gets passed a static string, but
chances are in the future it may get passed dynamically allocated strings,
prepare it for this.
While at it also make clear that its argument is a string, and simplify
things a bit by making use of this knowledge (pushing the strlen call down).
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'server/reds.c')
-rw-r--r-- | server/reds.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/server/reds.c b/server/reds.c index 5c469090..bbff68e5 100644 --- a/server/reds.c +++ b/server/reds.c @@ -1749,8 +1749,7 @@ static void reds_channel_do_link(RedChannel *channel, RedClient *client, if (link_msg->channel_type == SPICE_CHANNEL_INPUTS && !stream->ssl) { const char *mess = "keyboard channel is insecure"; - const int mess_len = strlen(mess); - main_channel_push_notify(reds->main_channel, (uint8_t*)mess, mess_len); + main_channel_push_notify(reds->main_channel, mess); } caps = (uint32_t *)((uint8_t *)link_msg + link_msg->caps_offset); |