[Kst] extragear/graphics/kst/src/datasources/dirfile

Don Wiebe dwiebe at physics.utoronto.ca
Tue Feb 13 22:01:30 CET 2007


SVN commit 633339 by wiebe:

Add missing space in GetDataErrorString ; don't clobber new_format_file unnecessarily


 M  +5 -4      getdata.c  


--- trunk/extragear/graphics/kst/src/datasources/dirfile/getdata.c #633338:633339
@@ -242,7 +242,7 @@
     case GD_E_OPEN_INCLUDE: /* Couldn't open an INCLUDEd file -- report the
                                included filename as well as the line and name
                                of the format file where it was encountered */
-      snprintf(ptr, buflen, "%s on line %i of %s", getdata_error_string,
+      snprintf(ptr, buflen, " %s on line %i of %s", getdata_error_string,
           getdata_error_line, getdata_error_file);
       break;
     case GD_E_BAD_RETURN_TYPE: /* unsupported data return type passed to
@@ -579,6 +579,7 @@
       F->frame_offset = atoi(in_cols[1]);
     } else if (strcmp(in_cols[0], "INCLUDE")==0) {
       int i, found = 0;
+      char temp_buffer[MAX_FILENAME_LENGTH + 6];
       char new_format_file[MAX_FILENAME_LENGTH + 6];
       char new_subdir[MAX_FILENAME_LENGTH + 1];
       FILE* new_fp = NULL;
@@ -613,12 +614,12 @@
 
       /* extract the subdirectory name - dirname both returns a volatile string
        * and modifies its argument, ergo strcpy */
-      strcpy(new_format_file, in_cols[1]);
+      strcpy(temp_buffer, in_cols[1]);
       if (strcmp(subdir, ".") == 0)
-        strcpy(new_subdir, dirname(new_format_file));
+        strcpy(new_subdir, dirname(temp_buffer));
       else
         snprintf(new_subdir, MAX_FILENAME_LENGTH, "%s/%s", subdir,
-            dirname(new_format_file));
+            dirname(temp_buffer));
 
       error_code = ParseFormatFile(new_fp, F, filedir, new_subdir,
           new_format_file, IncludeList, i_include);


More information about the Kst mailing list