}
 
        for_each_lang(scripts_path, scripts_dir, lang_dirent) {
-               snprintf(lang_path, MAXPATHLEN, "%s/%s/bin", scripts_path,
-                        lang_dirent->d_name);
+               scnprintf(lang_path, MAXPATHLEN, "%s/%s/bin", scripts_path,
+                         lang_dirent->d_name);
                lang_dir = opendir(lang_path);
                if (!lang_dir)
                        continue;
                        script_root = get_script_root(script_dirent, REPORT_SUFFIX);
                        if (script_root) {
                                desc = script_desc__findnew(script_root);
-                               snprintf(script_path, MAXPATHLEN, "%s/%s",
-                                        lang_path, script_dirent->d_name);
+                               scnprintf(script_path, MAXPATHLEN, "%s/%s",
+                                         lang_path, script_dirent->d_name);
                                read_script_info(desc, script_path);
                                free(script_root);
                        }
        int match, len;
        FILE *fp;
 
-       sprintf(filename, "%s/bin/%s-record", dir_name, scriptname);
+       scnprintf(filename, MAXPATHLEN, "%s/bin/%s-record", dir_name, scriptname);
 
        fp = fopen(filename, "r");
        if (!fp)
        }
 
        for_each_lang(scripts_path, scripts_dir, lang_dirent) {
-               snprintf(lang_path, MAXPATHLEN, "%s/%s", scripts_path,
-                        lang_dirent->d_name);
+               scnprintf(lang_path, MAXPATHLEN, "%s/%s", scripts_path,
+                         lang_dirent->d_name);
 #ifdef NO_LIBPERL
                if (strstr(lang_path, "perl"))
                        continue;
                return NULL;
 
        for_each_lang(scripts_path, scripts_dir, lang_dirent) {
-               snprintf(lang_path, MAXPATHLEN, "%s/%s/bin", scripts_path,
-                        lang_dirent->d_name);
+               scnprintf(lang_path, MAXPATHLEN, "%s/%s/bin", scripts_path,
+                         lang_dirent->d_name);
                lang_dir = opendir(lang_path);
                if (!lang_dir)
                        continue;
                                free(__script_root);
                                closedir(lang_dir);
                                closedir(scripts_dir);
-                               snprintf(script_path, MAXPATHLEN, "%s/%s",
-                                        lang_path, script_dirent->d_name);
+                               scnprintf(script_path, MAXPATHLEN, "%s/%s",
+                                         lang_path, script_dirent->d_name);
                                return strdup(script_path);
                        }
                        free(__script_root);
 
 
        n = perf_mem__snp_scnprintf(out, sizeof out, &mi);
        n += perf_mem__lvl_scnprintf(out + n, sizeof out - n, &mi);
-       snprintf(failure, sizeof failure, "unexpected %s", out);
+       scnprintf(failure, sizeof failure, "unexpected %s", out);
        TEST_ASSERT_VAL(failure, !strcmp(string, out));
        return 0;
 }