generic/60[78]: ensure the initial DAX file flag state before test
[xfstests-dev.git] / dmapi / src / sample_hsm / migout.c
index f62b1ecfd0ba12200614246180f0ff4cc3981f0a..d2e8b7885338ae84843d8653d9c22aa077a2ca66 100644 (file)
@@ -469,6 +469,7 @@ extract_fields(
        char    *cp, *start;
        size_t   len;
        char *hanp;
+       char *hanpp=NULL;
 
        /*
         * Skip any leading white space, and check the length
@@ -478,24 +479,17 @@ extract_fields(
        while (!isalnum(*cp))
                cp++;
 
-if( cp != ibuf )
-printf("%s/%d: found leading whitspace to skip\n", __FILE__, __LINE__);
-
        start = cp;
        while (isalnum(*cp))
                cp++;
        *cp = '\0';
 
-printf("%s/%d: start=(%s)\n", __FILE__, __LINE__, start);
-
        len = strtol(start, 0, 0);
        if (len > HANDLE_LEN) {
                err_msg("%s/%d: Handle length %d too long in input line", __FILE__, __LINE__, len);
                return(1);
        }
 
-printf("%s/%d: len=%ld\n", __FILE__, __LINE__, len);
-
        *hlen = len;
 
        /*
@@ -512,12 +506,9 @@ printf("%s/%d: len=%ld\n", __FILE__, __LINE__, len);
        cp += len*2;
        *cp = '\0';
 
-printf("%s/%d: handle buf is (%s)\n", __FILE__, __LINE__, hanp );
-
-       atohan( hanp, (void**)&handle_buf, &len );
-
-printf("%s/%d: len now=%ld\n", __FILE__, __LINE__, len);
-
+       atohan( hanp, (void**)&hanpp, &len );
+       memcpy( handle_buf, hanpp, len);
+       free( hanpp );
 
        /* skip over white space */
        while (!isalnum(*cp))
@@ -529,11 +520,8 @@ printf("%s/%d: len now=%ld\n", __FILE__, __LINE__, len);
                cp++;
        *cp = '\0';
 
-printf("%s/%d: file len=%s\n", __FILE__, __LINE__, start);
-
        *fsize = strtol(start, 0, 0);
 
-printf("%s/%d: fsize=%ld\n", __FILE__, __LINE__, *fsize);
        return(0);
 
 }