aboutsummaryrefslogtreecommitdiffstats
path: root/src/libqmi-glib/qmi-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/libqmi-glib/qmi-utils.c')
-rw-r--r--src/libqmi-glib/qmi-utils.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/src/libqmi-glib/qmi-utils.c b/src/libqmi-glib/qmi-utils.c
index d0df93b..a4028cb 100644
--- a/src/libqmi-glib/qmi-utils.c
+++ b/src/libqmi-glib/qmi-utils.c
@@ -47,32 +47,32 @@ __qmi_utils_str_hex (gconstpointer mem,
gchar delimiter)
{
const guint8 *data = mem;
- gsize i;
- gsize j;
- gsize new_str_length;
- gchar *new_str;
-
- /* Get new string length. If input string has N bytes, we need:
- * - 1 byte for last NUL char
- * - 2N bytes for hexadecimal char representation of each byte...
- * - N-1 bytes for the separator ':'
- * So... a total of (1+2N+N-1) = 3N bytes are needed... */
- new_str_length = 3 * size;
-
- /* Allocate memory for new array and initialize contents to NUL */
- new_str = g_malloc0 (new_str_length);
-
- /* Print hexadecimal representation of each byte... */
- for (i = 0, j = 0; i < size; i++, j += 3) {
- /* Print character in output string... */
- snprintf (&new_str[j], 3, "%02X", data[i]);
- /* And if needed, add separator */
- if (i != (size - 1) )
- new_str[j + 2] = delimiter;
- }
-
- /* Set output string */
- return new_str;
+ gsize i;
+ gsize j;
+ gsize new_str_length;
+ gchar *new_str;
+
+ /* Get new string length. If input string has N bytes, we need:
+ * - 1 byte for last NUL char
+ * - 2N bytes for hexadecimal char representation of each byte...
+ * - N-1 bytes for the separator ':'
+ * So... a total of (1+2N+N-1) = 3N bytes are needed... */
+ new_str_length = 3 * size;
+
+ /* Allocate memory for new array and initialize contents to NUL */
+ new_str = g_malloc0 (new_str_length);
+
+ /* Print hexadecimal representation of each byte... */
+ for (i = 0, j = 0; i < size; i++, j += 3) {
+ /* Print character in output string... */
+ snprintf (&new_str[j], 3, "%02X", data[i]);
+ /* And if needed, add separator */
+ if (i != (size - 1) )
+ new_str[j + 2] = delimiter;
+ }
+
+ /* Set output string */
+ return new_str;
}
/*****************************************************************************/