[libpri-commits] rmudgett: branch rmudgett/display_text r2186 - /team/rmudgett/display_text/
SVN commits to the libpri project
libpri-commits at lists.digium.com
Tue Feb 1 14:16:31 CST 2011
Author: rmudgett
Date: Tue Feb 1 14:16:26 2011
New Revision: 2186
URL: http://svnview.digium.com/svn/libpri?view=rev&rev=2186
Log:
Update some display text comments.
Modified:
team/rmudgett/display_text/libpri.h
team/rmudgett/display_text/q931.c
Modified: team/rmudgett/display_text/libpri.h
URL: http://svnview.digium.com/svn/libpri/team/rmudgett/display_text/libpri.h?view=diff&rev=2186&r1=2185&r2=2186
==============================================================================
--- team/rmudgett/display_text/libpri.h (original)
+++ team/rmudgett/display_text/libpri.h Tue Feb 1 14:16:26 2011
@@ -984,9 +984,16 @@
* iso10646-utf-8String(9)
*/
int char_set;
- /*! Number of octets in the display message */
+ /*!
+ * \brief Number of octets in the display message.
+ * \note Not including any added null terminator.
+ */
int length;
- /*! Display text data. */
+ /*!
+ * \brief Display text data.
+ * \note Null terminated on receive.
+ * \note Does not need to be null terminated on send.
+ */
char text[128];
};
Modified: team/rmudgett/display_text/q931.c
URL: http://svnview.digium.com/svn/libpri/team/rmudgett/display_text/q931.c?view=diff&rev=2186&r1=2185&r2=2186
==============================================================================
--- team/rmudgett/display_text/q931.c (original)
+++ team/rmudgett/display_text/q931.c Tue Feb 1 14:16:26 2011
@@ -1040,9 +1040,12 @@
if (call->display.length < sizeof(subcmd->u.display.text)) {
subcmd->u.display.length = call->display.length;
} else {
+ /* Truncate display text and leave room for a null terminator. */
subcmd->u.display.length = sizeof(subcmd->u.display.text) - 1;
}
memcpy(subcmd->u.display.text, call->display.text, subcmd->u.display.length);
+
+ /* Make sure display text is null terminated. */
subcmd->u.display.text[subcmd->u.display.length] = '\0';
}
}
More information about the libpri-commits
mailing list