diff options
author | Bill Meier <wmeier@newsguy.com> | 2009-03-17 19:28:05 +0000 |
---|---|---|
committer | Bill Meier <wmeier@newsguy.com> | 2009-03-17 19:28:05 +0000 |
commit | 4f01ce929b59e026fda3a03682faf532789ceb72 (patch) | |
tree | acec01e1c334bd5e51fc129953adabfe5f356e26 /epan/dissectors/packet-enttec.c | |
parent | 7a9ca393fbe616c6bad4e8ef8c7ce487044bf26b (diff) |
Add a comment about the way g_snprintf is used.
svn path=/trunk/; revision=27758
Diffstat (limited to 'epan/dissectors/packet-enttec.c')
-rw-r--r-- | epan/dissectors/packet-enttec.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/epan/dissectors/packet-enttec.c b/epan/dissectors/packet-enttec.c index 7c5e277fdb..aeaa6f1eda 100644 --- a/epan/dissectors/packet-enttec.c +++ b/epan/dissectors/packet-enttec.c @@ -280,6 +280,13 @@ dissect_enttec_dmx_data(tvbuff_t *tvb, guint offset, proto_tree *tree) row_count = (ui/global_disp_col_count) + ((ui%global_disp_col_count) == 0 ? 0 : 1); ptr = string; + /* XX: In theory the g_snprintf statements below could store '\0' bytes off the end of the */ + /* 'string' buffer'. This is so since g_snprint returns the number of characters which */ + /* "would have been written" (whether or not there was room) and since ptr is always */ + /* incremented by this amount. In practice the string buffer is large enough such that the */ + /* string buffer size is not exceeded even with the maximum number of columns which might */ + /* be displayed. */ + /* ToDo: consider recoding slightly ... */ for (r=0; r < row_count;r++) { for (c=0;(c < global_disp_col_count) && (((r*global_disp_col_count)+c) < ui);c++) { if ((c % (global_disp_col_count/2)) == 0) { |