From a8540003701c6701849619905be75080472d7d2e Mon Sep 17 00:00:00 2001 From: minack Date: Mon, 10 Aug 2009 23:02:31 +0000 Subject: [PATCH] Clean up comments for bac_str init functions. --- bacnet-stack/src/bacstr.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/bacnet-stack/src/bacstr.c b/bacnet-stack/src/bacstr.c index f2405307..e3909da8 100644 --- a/bacnet-stack/src/bacstr.c +++ b/bacnet-stack/src/bacstr.c @@ -226,7 +226,7 @@ bool bitstring_same( #define CHARACTER_STRING_CAPACITY (MAX_CHARACTER_STRING_BYTES - 1) /* returns false if the string exceeds capacity - initialize by using length=0 */ + initialize by using value=NULL */ bool characterstring_init( BACNET_CHARACTER_STRING * char_string, uint8_t encoding, @@ -453,7 +453,7 @@ uint8_t characterstring_encoding( } /* returns false if the string exceeds capacity - initialize by using value=0 */ + initialize by using value=NULL */ bool octetstring_init( BACNET_OCTET_STRING * octet_string, uint8_t * value, @@ -464,18 +464,17 @@ bool octetstring_init( if (octet_string) { octet_string->length = 0; - if (value) { - if (length <= MAX_OCTET_STRING_BYTES) { - for (i = 0; i < length; i++) { - octet_string->value[octet_string->length] = value[i]; - octet_string->length++; - } - status = true; - } - } else { - for (i = 0; i < MAX_OCTET_STRING_BYTES; i++) { - octet_string->value[i] = 0; - } + if (length <= MAX_OCTET_STRING_BYTES) { + if (value) { + for (i = 0; i < length; i++) { + octet_string->value[octet_string->length] = value[i]; + octet_string->length++; + } + } else { + for (i = 0; i < MAX_OCTET_STRING_BYTES; i++) { + octet_string->value[i] = 0; + } + } status = true; } }