weberr13 commented on code in PR #560: URL: https://github.com/apache/guacamole-server/pull/560#discussion_r2190832527
########## src/protocols/rdp/gdi.c: ########## @@ -190,6 +193,45 @@ BOOL guac_rdp_gdi_desktop_resize(rdpContext* context) { guac_display_layer_close_raw(default_layer, current_context); + /* Make json string containing monitor information */ + char json[JSON_BUFFER_SIZE]; + int pos = 0; + pos += snprintf(json + pos, JSON_BUFFER_SIZE - pos, "{"); + + for (int i = 0; i < rdp_client->disp->monitors_count; i++) { + + /* Skip monitors that have not been initialized yet */ + if (rdp_client->disp->monitors[i].requested_width == 0 || + rdp_client->disp->monitors[i].requested_height == 0) { + continue; + } + + /* Append monitor information to JSON string */ + pos += snprintf(json + pos, JSON_BUFFER_SIZE - pos, Review Comment: A small piece of my soul is severed and sent to the depths of Hades every time I see sprintf generating json. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: dev-unsubscr...@guacamole.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org