]> granicus.if.org Git - graphviz/commitdiff
smyrna sscanf -> strtok
authorarif <devnull@localhost>
Tue, 17 Nov 2009 15:53:11 +0000 (15:53 +0000)
committerarif <devnull@localhost>
Tue, 17 Nov 2009 15:53:11 +0000 (15:53 +0000)
cmd/smyrna/topview.c
cmd/smyrna/viewport.c

index 7addf8cfed7aa0f0bb488e406c11077fb188dca4..42c92458f7c335d2aa3437013bd69ce4652b355f 100755 (executable)
@@ -78,11 +78,27 @@ static void init_element_data(element_data * d)
 
 static void setpositioninfo(float *x, float *y, float *z, char *buf)
 {
+
     /*zero all values */
+    char* a;
+
+
     *x = 0;
     *y = 0;
     *z = 0;
-    sscanf(buf, "%f,%f,%f", x, y, z);
+    a=strtok(buf,",");
+    if(a)
+    *x=atof(a);
+    a=strtok(NULL,",");
+    if(a)
+    *y=atof(a);
+    a=strtok(NULL,",");
+    if(a)
+       *z=atof(a);
+
+
+
+//    sscanf(buf, "%f,%f,%f", x, y, z);
 }
 
 static void setglCompColor(glCompColor * c, char *colorstr)
index 09e7d7334f4876503a5d14fd3434914b7f974d18..e11e831bb8c4884c51f806fd973a194ae3366e4f 100755 (executable)
@@ -349,8 +349,8 @@ void init_viewport(ViewInfo * view)
 {
     FILE *input_file = NULL;
     FILE *input_file2 = NULL;
-    get_data_dir();
     static char* path;
+    get_data_dir();
 
     input_file = fopen(view->template_file, "rb");
     if (!input_file) {