Changeset: 5278615e8032 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/5278615e8032
Modified Files:
        gdk/gdk_bbp.c
Branch: Dec2023
Log Message:

Code cleanup.


diffs (32 lines):

diff --git a/gdk/gdk_bbp.c b/gdk/gdk_bbp.c
--- a/gdk/gdk_bbp.c
+++ b/gdk/gdk_bbp.c
@@ -4541,8 +4541,8 @@ BBPdiskscan(const char *parent, size_t b
        DIR *dirp = opendir(parent);
        struct dirent *dent;
        char fullname[FILENAME_MAX];
-       str dst = fullname;
-       size_t dstlen = sizeof(fullname);
+       str dst;
+       size_t dstlen;
        const char *src = parent;
 
        if (dirp == NULL) {
@@ -4551,14 +4551,10 @@ BBPdiskscan(const char *parent, size_t b
                return true;    /* nothing to do */
        }
 
-       while (*src) {
-               *dst++ = *src++;
-               dstlen--;
-       }
-       if (dst > fullname && dst[-1] != DIR_SEP) {
+       dst = stpcpy(fullname, src);
+       if (dst > fullname && dst[-1] != DIR_SEP)
                *dst++ = DIR_SEP;
-               dstlen--;
-       }
+       dstlen = sizeof(fullname) - (dst - fullname);
 
        while ((dent = readdir(dirp)) != NULL) {
                const char *p;
_______________________________________________
checkin-list mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to