Author: Daniel Leidert <daniel.leidert@wgdd.de>
Description: Fix build with hardening flags
Forwarded: yes

--- a/src/Display/GeomOrbXYZ.c
+++ b/src/Display/GeomOrbXYZ.c
@@ -1105,7 +1105,7 @@
 		sprintf(title,"[Gabedit Format]");
 		sprintf(message,"Sorry\nThis file is not a gabedit type file");
 	}
-	sprintf(titleCap,title);
+	sprintf(titleCap,"%s",title);
 	g_strup(titleCap);
 
  	for(i=0;i<5;i++)
@@ -1133,7 +1133,7 @@
 	if(!feof(fd))
 		fgets(t,taille,fd);
 
-	sprintf(tCap,t);
+	sprintf(tCap,"%s",t);
 	g_strup(tCap);
 
 	if(!strstr(tCap,titleCap))
@@ -2917,7 +2917,7 @@
     		else GeomOrb=g_realloc(GeomOrb,(j+1)*sizeof(TypeGeomOrb));
 
 		sscanf(t,"%s %s %s",AtomCoord[1],AtomCoord[2],AtomCoord[3]);
-		if(j<nElements) sprintf(AtomCoord[0],elements[j]);
+		if(j<nElements) sprintf(AtomCoord[0],"%s",elements[j]);
 		else sprintf(AtomCoord[0],"X");
 		AtomCoord[0][0]=toupper(AtomCoord[0][0]);
 		l=strlen(AtomCoord[0]); 
--- a/src/Display/OrbitalsGamess.c
+++ b/src/Display/OrbitalsGamess.c
@@ -576,7 +576,7 @@
 	}
 	for(k=0;k<Ncenters;k++)
 	{
-		sprintf(sym,GeomOrb[k].Symb);
+		sprintf(sym,"%s",GeomOrb[k].Symb);
 		i = GeomOrb[k].NumType;
 		/* printf("numType = %d\n",k);*/
      		Type[i].Symb=g_strdup(sym);
--- a/src/Files/ListeFiles.c
+++ b/src/Files/ListeFiles.c
@@ -1845,7 +1845,7 @@
 		{
 			model = gtk_tree_view_get_model(GTK_TREE_VIEW(widget));
 			gtk_tree_selection_select_path  (gtk_tree_view_get_selection (GTK_TREE_VIEW (widget)), path);
-			sprintf(selectedRow ,gtk_tree_path_to_string(path));
+			sprintf(selectedRow,"%s",gtk_tree_path_to_string(path));
 			gtk_tree_model_get_iter (model, &iter, path);
 			gtk_tree_path_free(path);
         		if (event->type == GDK_2BUTTON_PRESS &&  ((GdkEventButton *) event)->button == 1)
--- a/src/Display/OrbitalsNWChem.c
+++ b/src/Display/OrbitalsNWChem.c
@@ -492,7 +492,7 @@
 	}
 	for(k=0;k<Ncenters;k++)
 	{
-		sprintf(sym,GeomOrb[k].Symb);
+		sprintf(sym,"%s",GeomOrb[k].Symb);
 		i = GeomOrb[k].NumType;
 		/* printf("numType = %d\n",k);*/
      		Type[i].Symb=g_strdup(sym);
--- a/src/Display/OrbitalsQChem.c
+++ b/src/Display/OrbitalsQChem.c
@@ -594,7 +594,7 @@
 	}
 	for(k=0;k<Ncenters;k++)
 	{
-		sprintf(sym,GeomOrb[k].Symb);
+		sprintf(sym,"%s",GeomOrb[k].Symb);
 		i = GeomOrb[k].NumType;
 		/* printf("numType = %d\n",k);*/
      		Type[i].Symb=g_strdup(sym);
--- a/src/Gaussian/GInterfaceBasis.c
+++ b/src/Gaussian/GInterfaceBasis.c
@@ -536,7 +536,7 @@
 		{
 			model = gtk_tree_view_get_model(GTK_TREE_VIEW(widget));
 			gtk_tree_selection_select_path  (gtk_tree_view_get_selection (GTK_TREE_VIEW (widget)), path);
-			sprintf(selectedRowForType ,gtk_tree_path_to_string(path));
+			sprintf(selectedRowForType,"%s",gtk_tree_path_to_string(path));
 			gtk_tree_model_get_iter (model, &iter, path);
 			gtk_tree_path_free(path);
   			if (event->type == GDK_2BUTTON_PRESS && ((GdkEventButton *) event)->button == 1)
@@ -565,7 +565,7 @@
 		{
 			model = gtk_tree_view_get_model(GTK_TREE_VIEW(widget));
 			gtk_tree_selection_select_path  (gtk_tree_view_get_selection (GTK_TREE_VIEW (widget)), path);
-			sprintf(selectedRowForCenter ,gtk_tree_path_to_string(path));
+			sprintf(selectedRowForCenter,"%s",gtk_tree_path_to_string(path));
 			gtk_tree_model_get_iter (model, &iter, path);
 			gtk_tree_path_free(path);
   			if (event->type == GDK_2BUTTON_PRESS && ((GdkEventButton *) event)->button == 1)
--- a/src/Display/AnimationGeomConv.c
+++ b/src/Display/AnimationGeomConv.c
@@ -2301,7 +2301,7 @@
     		else listOfAtoms = g_realloc(listOfAtoms, (j+1)*sizeof(Atom));
 
 		sscanf(t,"%s %s %s",AtomCoord[1],AtomCoord[2],AtomCoord[3]);
-		if(j<nElements) sprintf(AtomCoord[0],elements[j]);
+		if(j<nElements) sprintf(AtomCoord[0],"%s",elements[j]);
 		else sprintf(AtomCoord[0],"X");
 		AtomCoord[0][0]=toupper(AtomCoord[0][0]);
 		l=strlen(AtomCoord[0]); 
--- a/src/Display/ContoursPov.c
+++ b/src/Display/ContoursPov.c
@@ -129,24 +129,24 @@
 	for(i=0;i<3;i++) C1[i] = plansgrid->point[ix][iy][iz].C[i] + Gap[i];
 	for(i=0;i<3;i++) C2[i] = plansgrid->point[ix1][iy1][iz1].C[i] + Gap[i];
 	temp = get_pov_cylingre(C1,C2,Color, 1.0);
-	fprintf(file,temp);
+	fprintf(file,"%s",temp);
 	g_free(temp);
 
 	for(i=0;i<3;i++) C1[i] = C2[i];
 	for(i=0;i<3;i++) C2[i] = plansgrid->point[ix2][iy2][iz2].C[i] + Gap[i];
 	temp = get_pov_cylingre(C1,C2,Color, 1.0);
-	fprintf(file,temp);
+	fprintf(file,"%s",temp);
 	g_free(temp);
 
 	for(i=0;i<3;i++) C1[i] = C2[i];
 	for(i=0;i<3;i++) C2[i] = plansgrid->point[ix3][iy3][iz3].C[i] + Gap[i];
 	temp = get_pov_cylingre(C1,C2,Color, 1.0);
-	fprintf(file,temp);
+	fprintf(file,"%s",temp);
 	g_free(temp);
 
 	for(i=0;i<3;i++) C1[i] = plansgrid->point[ix][iy][iz].C[i] + Gap[i];
 	temp = get_pov_cylingre(C1,C2,Color, 1.0);
-	fprintf(file,temp);
+	fprintf(file,"%s",temp);
 	g_free(temp);
 
 
@@ -173,7 +173,7 @@
 					for(l=0;l<3;l++) C1[l] = pointscontour[i][j].point[n].C[l] + Gap[l];
 					for(l=0;l<3;l++) C2[l] = pointscontour[i][j].point[n+1].C[l] + Gap[l];
 					temp = get_pov_cylingre(C1,C2,Color, 1.0);
-					fprintf(file,temp);
+					fprintf(file,"%s",temp);
 					g_free(temp);
 				}
 
--- a/src/Geometry/GeomXYZ.c
+++ b/src/Geometry/GeomXYZ.c
@@ -3303,7 +3303,7 @@
 		if(!read_atom_hin_file(fd,listFields, natoms,GeomXYZ[j].typeConnections,&nc))continue;
 		if(strcmp(listFields[0],"Unknown")==0)
 		{
-			sprintf(resName,listFields[1]);
+			sprintf(resName,"%s",listFields[1]);
 			i++;
 			continue;
 		}
@@ -8815,7 +8815,7 @@
    		GeomXYZ[j].typeConnections = NULL;
 
 		sscanf(t,"%s %s %s",AtomCoord[1],AtomCoord[2],AtomCoord[3]);
-		if(j<nElements) sprintf(AtomCoord[0],elements[j]);
+		if(j<nElements) sprintf(AtomCoord[0],"%s",elements[j]);
 		else sprintf(AtomCoord[0],"X");
 		AtomCoord[0][0]=toupper(AtomCoord[0][0]);
 		l=strlen(AtomCoord[0]); 
--- a/src/Geometry/ResultsAnalise.c
+++ b/src/Geometry/ResultsAnalise.c
@@ -215,8 +215,8 @@
                  	}
 		 	GeomConv[Ncalculs-1].Data[0][GeomConv[Ncalculs-1].Npoint-1] = g_malloc(50*sizeof(char)); 
 		 	GeomConv[Ncalculs-1].TypeCalcul = g_strdup(" ");
-                 	sprintf(GeomConv[Ncalculs-1].Data[0][GeomConv[Ncalculs-1].Npoint-1], tmp);
-                 	sprintf(GeomConv[Ncalculs-1].Data[1][GeomConv[Ncalculs-1].Npoint-1], temp);
+                 	sprintf(GeomConv[Ncalculs-1].Data[0][GeomConv[Ncalculs-1].Npoint-1], "%s", tmp);
+                 	sprintf(GeomConv[Ncalculs-1].Data[1][GeomConv[Ncalculs-1].Npoint-1], "%s", temp);
 		}
 	}
 	fclose(fd);
@@ -913,8 +913,8 @@
                  	}
 		 	GeomConv[Ncalculs-1].Data[0][GeomConv[Ncalculs-1].Npoint-1] = g_malloc(50*sizeof(char)); 
 		 	GeomConv[Ncalculs-1].TypeCalcul = g_strdup(" ");
-                 	sprintf(GeomConv[Ncalculs-1].Data[0][GeomConv[Ncalculs-1].Npoint-1], tmp);
-                 	sprintf(GeomConv[Ncalculs-1].Data[1][GeomConv[Ncalculs-1].Npoint-1], temp);
+                 	sprintf(GeomConv[Ncalculs-1].Data[0][GeomConv[Ncalculs-1].Npoint-1], "%s", tmp);
+                 	sprintf(GeomConv[Ncalculs-1].Data[1][GeomConv[Ncalculs-1].Npoint-1], "%s", temp);
 		}
 	}
 	fclose(fd);
@@ -1052,9 +1052,9 @@
                  	}
 		 	GeomConv[Ncalculs-1].Data[0][GeomConv[Ncalculs-1].Npoint-1] = g_malloc(50*sizeof(char)); 
 		 	GeomConv[Ncalculs-1].TypeCalcul = g_strdup(" ");
-                 	sprintf(GeomConv[Ncalculs-1].Data[0][GeomConv[Ncalculs-1].Npoint-1], tmp);
-                 	sprintf(GeomConv[Ncalculs-1].Data[1][GeomConv[Ncalculs-1].Npoint-1], maxgrad);
-                 	sprintf(GeomConv[Ncalculs-1].Data[2][GeomConv[Ncalculs-1].Npoint-1], rmsgrad);
+                 	sprintf(GeomConv[Ncalculs-1].Data[0][GeomConv[Ncalculs-1].Npoint-1], "%s", tmp);
+                 	sprintf(GeomConv[Ncalculs-1].Data[1][GeomConv[Ncalculs-1].Npoint-1], "%s", maxgrad);
+                 	sprintf(GeomConv[Ncalculs-1].Data[2][GeomConv[Ncalculs-1].Npoint-1], "%s", rmsgrad);
 		}
 	}
 	fclose(fd);
@@ -1175,9 +1175,9 @@
                  	}
 		 	GeomConv[Ncalculs-1].Data[0][GeomConv[Ncalculs-1].Npoint-1] = g_malloc(50*sizeof(char)); 
 		 	GeomConv[Ncalculs-1].TypeCalcul = g_strdup(" ");
-                 	sprintf(GeomConv[Ncalculs-1].Data[0][GeomConv[Ncalculs-1].Npoint-1], tmp);
-                 	sprintf(GeomConv[Ncalculs-1].Data[1][GeomConv[Ncalculs-1].Npoint-1], maxgrad);
-                 	sprintf(GeomConv[Ncalculs-1].Data[2][GeomConv[Ncalculs-1].Npoint-1], rmsgrad);
+                 	sprintf(GeomConv[Ncalculs-1].Data[0][GeomConv[Ncalculs-1].Npoint-1], "%s", tmp);
+                 	sprintf(GeomConv[Ncalculs-1].Data[1][GeomConv[Ncalculs-1].Npoint-1], "%s", maxgrad);
+                 	sprintf(GeomConv[Ncalculs-1].Data[2][GeomConv[Ncalculs-1].Npoint-1], "%s", rmsgrad);
 		}
 	}
 	fclose(fd);
@@ -1284,7 +1284,7 @@
                	}
 	 	GeomConv[Ncalculs-1].Data[0][GeomConv[Ncalculs-1].Npoint-1] = g_malloc(50*sizeof(char)); 
 	 	GeomConv[Ncalculs-1].TypeCalcul = g_strdup(" ");
-               	sprintf(GeomConv[Ncalculs-1].Data[0][GeomConv[Ncalculs-1].Npoint-1], tmp);
+               	sprintf(GeomConv[Ncalculs-1].Data[0][GeomConv[Ncalculs-1].Npoint-1], "%s", tmp);
 	}
 	fclose(fd);
    
--- a/src/Display/PlanesMappedPov.c
+++ b/src/Display/PlanesMappedPov.c
@@ -199,24 +199,24 @@
 	for(i=0;i<3;i++) C1[i] = plansgrid->point[ix][iy][iz].C[i] + Gap[i];
 	for(i=0;i<3;i++) C2[i] = plansgrid->point[ix1][iy1][iz1].C[i] + Gap[i];
 	temp = get_pov_cylingre(C1,C2,Color, 1.0);
-	fprintf(file,temp);
+	fprintf(file,"%s",temp);
 	g_free(temp);
 
 	for(i=0;i<3;i++) C1[i] = C2[i];
 	for(i=0;i<3;i++) C2[i] = plansgrid->point[ix2][iy2][iz2].C[i] + Gap[i];
 	temp = get_pov_cylingre(C1,C2,Color, 1.0);
-	fprintf(file,temp);
+	fprintf(file,"%s",temp);
 	g_free(temp);
 
 	for(i=0;i<3;i++) C1[i] = C2[i];
 	for(i=0;i<3;i++) C2[i] = plansgrid->point[ix3][iy3][iz3].C[i] + Gap[i];
 	temp = get_pov_cylingre(C1,C2,Color, 1.0);
-	fprintf(file,temp);
+	fprintf(file,"%s",temp);
 	g_free(temp);
 
 	for(i=0;i<3;i++) C1[i] = plansgrid->point[ix][iy][iz].C[i] + Gap[i];
 	temp = get_pov_cylingre(C1,C2,Color, 1.0);
-	fprintf(file,temp);
+	fprintf(file,"%s",temp);
 	g_free(temp);
 
 
@@ -417,7 +417,7 @@
 	for(k=0;k<3;k++) C4[k] = plansgrid->point[ix3][iy3][iz3].C[k] + Gap[k];
 
 	temp = get_pov_mesh2(C1, C2, C3, C4, N1, N2, N3, N4, color1,  color2, color3, color4);
-	fprintf(file,temp);
+	fprintf(file,"%s",temp);
 	g_free(temp);
 	}
 	g_free(Gap);
--- a/src/Geometry/OpenBabel.c
+++ b/src/Geometry/OpenBabel.c
@@ -230,7 +230,7 @@
 		gchar* p = g_strdup(patterns[0]);
 		g_free(patterns[0]);
 		patterns[0] = g_malloc(100*sizeof(gchar));
-		sprintf(patterns[0],p);
+		sprintf(patterns[0],"%s",p);
 		g_free(p);
 	}
 	g_object_set_data (G_OBJECT (hbox), "Patterns",patterns);
--- a/src/Display/RingsPov.c
+++ b/src/Display/RingsPov.c
@@ -148,7 +148,7 @@
 		}
 
 		temp = get_pov_polygon(rings[i], ringsSize[i], color);
-		fprintf(file,temp);
+		fprintf(file,"%s",temp);
 		g_free(temp);
 	}
 	fclose(file);
--- a/src/Geometry/SelectionDlg.c
+++ b/src/Geometry/SelectionDlg.c
@@ -68,7 +68,7 @@
 		{
 			model = gtk_tree_view_get_model(GTK_TREE_VIEW(widget));
 			gtk_tree_selection_select_path  (gtk_tree_view_get_selection (GTK_TREE_VIEW (widget)), path);
-			sprintf(selectedRow ,gtk_tree_path_to_string(path));
+			sprintf(selectedRow,"%s",gtk_tree_path_to_string(path));
 			gtk_tree_model_get_iter (model, &iter, path);
 			gtk_tree_path_free(path);
 			/* printf("%s\n",selectedRow);*/
--- a/src/Display/LabelsGL.c
+++ b/src/Display/LabelsGL.c
@@ -504,7 +504,7 @@
 	yValue = gtk_spin_button_get_value (GTK_SPIN_BUTTON(ySpinButton));
 	if(xValue>=0 && xValue<=100) xTitle = xValue;
 	if(yValue>=0 && yValue<=100) yTitle = yValue;
-	if(fontStr) sprintf(fontNameTitle,fontStr);
+	if(fontStr) sprintf(fontNameTitle,"%s",fontStr);
 	if(str && strlen(str)>1)
 	{
 		if(strTitle) g_free(strTitle);
--- a/src/Molpro/MolproBasisLibrary.c
+++ b/src/Molpro/MolproBasisLibrary.c
@@ -346,7 +346,7 @@
 		{
 			model = gtk_tree_view_get_model(GTK_TREE_VIEW(widget));
 			gtk_tree_selection_select_path  (gtk_tree_view_get_selection (GTK_TREE_VIEW (widget)), path);
-			sprintf(selectedRow ,gtk_tree_path_to_string(path));
+			sprintf(selectedRow,"%s",gtk_tree_path_to_string(path));
 			gtk_tree_model_get_iter (model, &iter, path);
 			gtk_tree_path_free(path);
   			if (event->type == GDK_BUTTON_PRESS && ((GdkEventButton *) event)->button == 3)
--- a/src/MolecularMechanics/SetMMParameters.c
+++ b/src/MolecularMechanics/SetMMParameters.c
@@ -240,7 +240,7 @@
 			gint nList = gtk_notebook_get_current_page(GTK_NOTEBOOK(NoteBook));
 			model = gtk_tree_view_get_model(GTK_TREE_VIEW(widget));
 			gtk_tree_selection_select_path  (gtk_tree_view_get_selection (GTK_TREE_VIEW (widget)), path);
-			sprintf(rowSelectedLists[nList] ,gtk_tree_path_to_string(path));
+			sprintf(rowSelectedLists[nList],"%s",gtk_tree_path_to_string(path));
 			gtk_tree_model_get_iter (model, &iter, path);
 			gtk_tree_path_free(path);
 			if (event->type == GDK_2BUTTON_PRESS) editDlg(NULL, NULL);
--- a/src/Molcas/MolcasScf.c
+++ b/src/Molcas/MolcasScf.c
@@ -88,9 +88,9 @@
 {
 	gint i;
 
-	sprintf( newCopy->title, toCopy->title);
-	sprintf( newCopy->type, toCopy->type);
-	sprintf( newCopy->method, toCopy->method);
+	sprintf( newCopy->title, "%s", toCopy->title);
+	sprintf( newCopy->type, "%s", toCopy->type);
+	sprintf( newCopy->method, "%s", toCopy->method);
 
 	newCopy->typeOfOcupations = toCopy->typeOfOcupations;
 
@@ -338,7 +338,7 @@
 	entryText = gtk_entry_get_text(GTK_ENTRY(entry));
 	if(strlen(entryText)<1)return;
 
-	sprintf(molcasScfTmp.type,entryText);
+	sprintf(molcasScfTmp.type,"%s",entryText);
 	comboCharge  = g_object_get_data(G_OBJECT (entry), "Combo");
 	if(!GTK_IS_WIDGET(comboCharge)) return;
 	if(strcmp(molcasScfTmp.type,"Restricted")==0) setComboCharge(comboCharge, TRUE);
@@ -355,7 +355,7 @@
 	entryText = gtk_entry_get_text(GTK_ENTRY(entry));
 	if(strlen(entryText)<1)return;
 
-	sprintf(molcasScfTmp.method,entryText);
+	sprintf(molcasScfTmp.method,"%s",entryText);
 }
 /*********************************************************************************************/
 static GtkWidget* addComboListToATable(GtkWidget* table,
--- a/src/Molcas/MolcasVariables.c
+++ b/src/Molcas/MolcasVariables.c
@@ -101,7 +101,7 @@
 /************************************************************************************************************/
 void molcasWorkDir(gchar* workDir)
 {
-	sprintf(workDir,molcasSystemVariables.workDir);
+	sprintf(workDir,"%s",molcasSystemVariables.workDir);
 }
 /************************************************************************************************************/
 static void initMolcasSystemVariables(MolcasSystemVariables* mSystemVariables)
@@ -121,11 +121,11 @@
 static void copySystemVariablesParameters(MolcasSystemVariables* newCopy, MolcasSystemVariables* toCopy)
 {
 
-	sprintf( newCopy->mem, toCopy->mem);
-	sprintf( newCopy->disk, toCopy->disk);
-	sprintf( newCopy->ramd, toCopy->ramd);
-	sprintf( newCopy->trap, toCopy->trap);
-	sprintf( newCopy->workDir, toCopy->workDir);
+	sprintf( newCopy->mem, "%s", toCopy->mem);
+	sprintf( newCopy->disk, "%s", toCopy->disk);
+	sprintf( newCopy->ramd, "%s", toCopy->ramd);
+	sprintf( newCopy->trap, "%s", toCopy->trap);
+	sprintf( newCopy->workDir, "%s", toCopy->workDir);
 }
 /************************************************************************************************************/
 static void copySystemVariablesParametersFromTmp(GtkWidget *win, gpointer data)
@@ -159,7 +159,7 @@
 			}
 
 			if(strstr(entrytext,_("Default")) || strstr(entrytext,_("largest possible")) || atof(entrytext) != 0)
-				sprintf(molcasSystemVariablesTmp.mem,entrytext);
+				sprintf(molcasSystemVariablesTmp.mem,"%s",entrytext);
 
 			break;
 		case MOLCAS_TYPE_VARIABLE_DISK :
@@ -173,7 +173,7 @@
 			}
 
 			if(strstr(entrytext,_("Default")) || strstr(entrytext,_("Limited to 2 GBytes")) || atof(entrytext) != 0)
-				sprintf(molcasSystemVariablesTmp.disk, entrytext);
+				sprintf(molcasSystemVariablesTmp.disk,"%s",entrytext);
 			break;
 		case MOLCAS_TYPE_VARIABLE_RAMD :
 			if(strstr(entrytext,_("Default")))
@@ -185,11 +185,11 @@
 				gtk_widget_set_sensitive(entry, TRUE);
 			}
 			if(strstr(entrytext,_("Default")) || atof(entrytext) != 0)
-			sprintf(molcasSystemVariablesTmp.ramd, entrytext);
+			sprintf(molcasSystemVariablesTmp.ramd,"%s",entrytext);
 			break;
 		case MOLCAS_TYPE_VARIABLE_TRAP :
 			gtk_widget_set_sensitive(entry, FALSE);
-			sprintf(molcasSystemVariablesTmp.trap, entrytext);
+			sprintf(molcasSystemVariablesTmp.trap,"%s",entrytext);
 			break;
 		case MOLCAS_TYPE_VARIABLE_WORKDIR :
 			if(strstr(entrytext,_("Default")))
@@ -200,7 +200,7 @@
 			{
 				gtk_widget_set_sensitive(entry, TRUE);
 			}
-			sprintf(molcasSystemVariablesTmp.workDir, entrytext);
+			sprintf(molcasSystemVariablesTmp.workDir,"%s",entrytext);
 			break;
 	}
 }
--- a/src/MolecularMechanics/PDBTemplate.c
+++ b/src/MolecularMechanics/PDBTemplate.c
@@ -192,7 +192,7 @@
 			{
 				if(!typeTemplates[k].pdbType) break;
 				if(typeTemplates[k].pdbType[0]!='H') break;
-				sprintf(hAtoms[nH],typeTemplates[k].pdbType);
+				sprintf(hAtoms[nH],"%s",typeTemplates[k].pdbType);
 				nH++;
 				if(nH>10) break;
 			}
--- a/src/Molcas/MolcasBasisLibrary.c
+++ b/src/Molcas/MolcasBasisLibrary.c
@@ -318,7 +318,7 @@
 		{
 			model = gtk_tree_view_get_model(GTK_TREE_VIEW(widget));
 			gtk_tree_selection_select_path  (gtk_tree_view_get_selection (GTK_TREE_VIEW (widget)), path);
-			sprintf(selectedRow ,gtk_tree_path_to_string(path));
+			sprintf(selectedRow,"%s",gtk_tree_path_to_string(path));
 			gtk_tree_model_get_iter (model, &iter, path);
 			gtk_tree_path_free(path);
   			if (event->type == GDK_BUTTON_PRESS && ((GdkEventButton *) event)->button == 3)
--- a/src/MolecularMechanics/SetPDBTemplate.c
+++ b/src/MolecularMechanics/SetPDBTemplate.c
@@ -853,7 +853,7 @@
 		{
 			model = gtk_tree_view_get_model(GTK_TREE_VIEW(widget));
 			gtk_tree_selection_select_path  (gtk_tree_view_get_selection (GTK_TREE_VIEW (widget)), path);
-			sprintf(selectedRow ,gtk_tree_path_to_string(path));
+			sprintf(selectedRow,"%s",gtk_tree_path_to_string(path));
 			gtk_tree_model_get_iter (model, &iter, path);
 			gtk_tree_path_free(path);
   			if (event->type == GDK_BUTTON_PRESS && ((GdkEventButton *) event)->button == 3)
--- a/src/MPQC/MPQCBasisLibrary.c
+++ b/src/MPQC/MPQCBasisLibrary.c
@@ -299,7 +299,7 @@
 		{
 			model = gtk_tree_view_get_model(GTK_TREE_VIEW(widget));
 			gtk_tree_selection_select_path  (gtk_tree_view_get_selection (GTK_TREE_VIEW (widget)), path);
-			sprintf(selectedRow ,gtk_tree_path_to_string(path));
+			sprintf(selectedRow,"%s",gtk_tree_path_to_string(path));
 			gtk_tree_model_get_iter (model, &iter, path);
 			gtk_tree_path_free(path);
   			if (event->type == GDK_BUTTON_PRESS && ((GdkEventButton *) event)->button == 3)
--- a/src/Gamess/GamessMolecule.c
+++ b/src/Gamess/GamessMolecule.c
@@ -598,7 +598,7 @@
 
 	if(MethodeGeom==GEOM_IS_XYZ && (nrvar== 3*NcentersXYZ || nrvar==0))
 	{
-		sprintf(pointGroupSymbol,gamessMolecule.groupSymmetry);
+		sprintf(pointGroupSymbol,"%s",gamessMolecule.groupSymmetry);
 		computeSymmetry(principalAxisTolerance, FALSE, pointGroupSymbol,maximalOrder, TRUE, &numberOfAtoms,symbols, X, Y, Z, &positionTolerance, message);
 		/*
 		if(strlen(pointGroupSymbol)>1 && strcmp(pointGroupSymbol,"C1")!=0 && isdigit(pointGroupSymbol[1]))
--- a/src/NetWork/Process.c
+++ b/src/NetWork/Process.c
@@ -755,7 +755,7 @@
 		{
 			model = gtk_tree_view_get_model(GTK_TREE_VIEW(widget));
 			gtk_tree_selection_select_path  (gtk_tree_view_get_selection (GTK_TREE_VIEW (widget)), path);
-			sprintf(selectedRow ,gtk_tree_path_to_string(path));
+			sprintf(selectedRow,"%s",gtk_tree_path_to_string(path));
 			gtk_tree_model_get_iter (model, &iter, path);
 			gtk_tree_path_free(path);
   			if (event->type == GDK_2BUTTON_PRESS && ((GdkEventButton *) event)->button == 1)
--- a/src/NetWork/Batch.c
+++ b/src/NetWork/Batch.c
@@ -390,7 +390,7 @@
 		{
 			model = gtk_tree_view_get_model(GTK_TREE_VIEW(widget));
 			gtk_tree_selection_select_path  (gtk_tree_view_get_selection (GTK_TREE_VIEW (widget)), path);
-			sprintf(selectedRow ,gtk_tree_path_to_string(path));
+			sprintf(selectedRow,"%s",gtk_tree_path_to_string(path));
 			gtk_tree_model_get_iter (model, &iter, path);
 			gtk_tree_path_free(path);
   			if (event->type == GDK_2BUTTON_PRESS && ((GdkEventButton *) event)->button == 1)
@@ -725,7 +725,7 @@
   		remotehost = gtk_entry_get_text(GTK_ENTRY(EntryRemote));
   		remoteuser = gtk_entry_get_text(GTK_ENTRY(EntryLogin));
 		remotepassword = gtk_entry_get_text(GTK_ENTRY(EntryPassWord));
-  		command = g_strdup_printf(NameCommandBatchAll);
+  		command = g_strdup_printf("%s",NameCommandBatchAll);
   		title = g_strdup_printf(_("All Jobs in %s host "),remotehost);
   		/*rsh (fout,ferr,command, remoteuser,remotehost);*/
 		remote_command (fout,ferr,command,remotehost,remoteuser,remotepassword);
--- a/src/Utils/GabeditXYPlot.c
+++ b/src/Utils/GabeditXYPlot.c
@@ -138,7 +138,7 @@
 	dialog = gtk_message_dialog_new_with_markup (NULL,
 		           GTK_DIALOG_DESTROY_WITH_PARENT,
 		           GTK_MESSAGE_INFO, GTK_BUTTONS_OK,
-			   message);
+			   "%s", message);
        	gtk_dialog_run (GTK_DIALOG (dialog));
        	gtk_widget_destroy (dialog);
 }
@@ -4449,7 +4449,7 @@
 		dialog = gtk_message_dialog_new_with_markup (NULL,
 		           GTK_DIALOG_DESTROY_WITH_PARENT,
 		           GTK_MESSAGE_INFO, GTK_BUTTONS_OK,
-			   tmp);
+			   "%s", tmp);
        		gtk_dialog_run (GTK_DIALOG (dialog));
        		gtk_widget_destroy (dialog);
        		g_free(tmp);
@@ -4839,7 +4839,7 @@
 		dialog = gtk_message_dialog_new_with_markup (NULL,
 		           GTK_DIALOG_DESTROY_WITH_PARENT,
 		           GTK_MESSAGE_INFO, GTK_BUTTONS_OK,
-			   tmp);
+			   "%s", tmp);
        		gtk_dialog_run (GTK_DIALOG (dialog));
        		gtk_widget_destroy (dialog);
        		g_free(tmp);
@@ -5259,7 +5259,7 @@
 		if(!d) return;
 		if(data)
 		{
-			sprintf(data->point_str,d);
+			sprintf(data->point_str,"%s",d);
 			xyplot_build_points_data(GABEDIT_XYPLOT(xyplot), data);
 		}
 		else
@@ -5269,7 +5269,7 @@
 			for (; current_node!=NULL; current_node=current_node->next)
 			{
 				data=(XYPlotData*)current_node->data;  
-				sprintf(data->point_str,d);
+				sprintf(data->point_str,"%s",d);
 				xyplot_build_points_data(GABEDIT_XYPLOT(xyplot), data);
 			}
 		}
@@ -8713,7 +8713,7 @@
 	dialog = gtk_message_dialog_new_with_markup (NULL,
 		           GTK_DIALOG_DESTROY_WITH_PARENT,
 		           GTK_MESSAGE_INFO, GTK_BUTTONS_OK,
-			   tmp);
+			   "%s", tmp);
        gtk_dialog_run (GTK_DIALOG (dialog));
        gtk_widget_destroy (dialog);
        g_free(tmp);
--- a/src/Utils/GabeditContoursPlot.c
+++ b/src/Utils/GabeditContoursPlot.c
@@ -120,7 +120,7 @@
 	dialog = gtk_message_dialog_new_with_markup (NULL,
 		           GTK_DIALOG_DESTROY_WITH_PARENT,
 		           GTK_MESSAGE_INFO, GTK_BUTTONS_OK,
-			   message);
+			   "%s", message);
        	gtk_dialog_run (GTK_DIALOG (dialog));
        	gtk_widget_destroy (dialog);
 }
@@ -1496,12 +1496,12 @@
 	dialog = gtk_message_dialog_new_with_markup (NULL,
                  GTK_DIALOG_DESTROY_WITH_PARENT,
 		GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
-		message);
+		"%s", message);
 	else
 	dialog = gtk_message_dialog_new_with_markup (NULL,
                  GTK_DIALOG_DESTROY_WITH_PARENT,
 		GTK_MESSAGE_INFO, GTK_BUTTONS_OK,
-		message);
+		"%s", message);
 
 	if(dialog)
 	{
@@ -2962,7 +2962,7 @@
 		dialog = gtk_message_dialog_new_with_markup (NULL,
 		           GTK_DIALOG_DESTROY_WITH_PARENT,
 		           GTK_MESSAGE_INFO, GTK_BUTTONS_OK,
-			   tmp);
+			   "%s", tmp);
        		gtk_dialog_run (GTK_DIALOG (dialog));
        		gtk_widget_destroy (dialog);
        		g_free(tmp);
@@ -2983,7 +2983,7 @@
 		dialog = gtk_message_dialog_new_with_markup (NULL,
 		           GTK_DIALOG_DESTROY_WITH_PARENT,
 		           GTK_MESSAGE_INFO, GTK_BUTTONS_OK,
-			   tmp);
+			   "%s", tmp);
        		gtk_dialog_run (GTK_DIALOG (dialog));
        		gtk_widget_destroy (dialog);
        		g_free(tmp);
@@ -2997,7 +2997,7 @@
 		dialog = gtk_message_dialog_new_with_markup (NULL,
 		           GTK_DIALOG_DESTROY_WITH_PARENT,
 		           GTK_MESSAGE_INFO, GTK_BUTTONS_OK,
-			   tmp);
+			   "%s", tmp);
        		gtk_dialog_run (GTK_DIALOG (dialog));
        		gtk_widget_destroy (dialog);
        		g_free(tmp);
@@ -5220,7 +5220,7 @@
 		if(!d) return;
 		if(contour)
 		{
-			sprintf(contour->point_str,d);
+			sprintf(contour->point_str,"%s",d);
 			contoursplot_build_points_contour(GABEDIT_ContoursPLOT(contoursplot), contour);
 		}
 		gtk_widget_queue_draw(GTK_WIDGET(contoursplot));
@@ -9355,7 +9355,7 @@
 	dialog = gtk_message_dialog_new_with_markup (NULL,
 		           GTK_DIALOG_DESTROY_WITH_PARENT,
 		           GTK_MESSAGE_INFO, GTK_BUTTONS_OK,
-			   tmp);
+			   "%s", tmp);
        gtk_dialog_run (GTK_DIALOG (dialog));
        gtk_widget_destroy (dialog);
        g_free(tmp);
--- a/src/Symmetry/MoleculeSymmetry.c
+++ b/src/Symmetry/MoleculeSymmetry.c
@@ -775,7 +775,7 @@
 
       	for (i=0;i < mol.numberOfAtoms;i++)
 	{ 
-		sprintf(symbols[i],mol.symbol[mol.listOfAtoms[i].type]);
+		sprintf(symbols[i],"%s",mol.symbol[mol.listOfAtoms[i].type]);
 		X[i] = mol.listOfAtoms[i].position[0];
 		Y[i] = mol.listOfAtoms[i].position[1];
 		Z[i] = mol.listOfAtoms[i].position[2];
@@ -912,7 +912,7 @@
 	*/
       	for (i=0;i < mol.numberOfAtoms;i++)
 	{ 
-		sprintf(symbols[i],mol.symbol[mol.listOfAtoms[i].type]);
+		sprintf(symbols[i],"%s",mol.symbol[mol.listOfAtoms[i].type]);
 		X[i] = mol.listOfAtoms[i].position[0];
 		Y[i] = mol.listOfAtoms[i].position[1];
 		Z[i] = mol.listOfAtoms[i].position[2];
--- a/src/FireFly/FireFlyMolecule.c
+++ b/src/FireFly/FireFlyMolecule.c
@@ -654,7 +654,7 @@
 
 	if(MethodeGeom==GEOM_IS_XYZ && (nrvar== 3*NcentersXYZ || nrvar==0))
 	{
-		sprintf(pointGroupSymbol,fireflyMolecule.groupSymmetry);
+		sprintf(pointGroupSymbol,"%s",fireflyMolecule.groupSymmetry);
 		computeSymmetry(principalAxisTolerance, FALSE, pointGroupSymbol,maximalOrder, TRUE, &numberOfAtoms,symbols, X, Y, Z, &positionTolerance, message);
 		/*
 		if(strlen(pointGroupSymbol)>1 && strcmp(pointGroupSymbol,"C1")!=0 && isdigit(pointGroupSymbol[1]))
