[rtems commit] libblock: Add comment

Sebastian Huber sebh at rtems.org
Sun Oct 11 13:51:23 UTC 2020


Module:    rtems
Branch:    master
Commit:    243d3ed51d0fa47ab23e3a13c4487a8609cdd05c
Changeset: http://git.rtems.org/rtems/commit/?id=243d3ed51d0fa47ab23e3a13c4487a8609cdd05c

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Sun Oct 11 15:50:28 2020 +0200

libblock: Add comment

---

 cpukit/libblock/src/bdpart-register.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/cpukit/libblock/src/bdpart-register.c b/cpukit/libblock/src/bdpart-register.c
index 8a1de61..857c016 100644
--- a/cpukit/libblock/src/bdpart-register.c
+++ b/cpukit/libblock/src/bdpart-register.c
@@ -38,6 +38,7 @@ static char *create_logical_disk_name( const char *disk_name, char **marker)
   char *logical_disk_name = malloc( disk_name_size + RTEMS_BDPART_NUMBER_SIZE);
 
   if (logical_disk_name != NULL) {
+    /* The string is NUL terminated by (A) ... */
     memcpy( logical_disk_name, disk_name, disk_name_size);
     *marker = logical_disk_name + disk_name_size;
   }
@@ -53,6 +54,7 @@ static rtems_status_code update_logical_disk_name(
   rtems_status_code sc = RTEMS_SUCCESSFUL;
   int rv = 0;
 
+  /* ... (A) */
   rv = snprintf( logical_disk_marker, RTEMS_BDPART_NUMBER_SIZE, "%zu", i + 1);
   if (rv >= RTEMS_BDPART_NUMBER_SIZE) {
     sc = RTEMS_INVALID_NAME;



More information about the vc mailing list