@@ -116,27 +116,24 @@ int sql_insert_file(MYSQL* conn, const char* user_name, const char* dir_id, int
116116 MYSQL_ROW row ;
117117 char file_path [RESULT_LEN ];
118118
119- printf ("filename=%s\n" ,file_name );
120- char filename [RESULT_LEN ];
121- sprintf (filename , "%s" , file_name );
122119 res = sql_select (conn , "file" , "id" , dir_id , 0 );
123120 if (res == NULL )
124121 {
125122 return -1 ;
126123 }
127124 row = mysql_fetch_row (res );
128125 mysql_free_result (res );
129- sprintf (file_path , "%s/%s" , row [5 ], filename );
126+ sprintf (file_path , "%s/%s" , row [5 ], file_name );
130127
131128 if (type == 0 )
132129 {
133130 sprintf (query , "INSERT INTO file VALUES (default, %s, %d, '%s', NULL, '%s', NULL, default)" ,
134- dir_id , type , filename , file_path );
131+ dir_id , type , file_name , file_path );
135132 }
136133 else
137134 {
138135 sprintf (query , "INSERT INTO file VALUES (default, %s, %d, '%s', %d, '%s', '%s', default)" ,
139- dir_id , type , filename , file_size , file_path , file_md5 );
136+ dir_id , type , file_name , file_size , file_path , file_md5 );
140137 }
141138#ifdef _DEBUG
142139 printf ("sql: %s\n" , query );
0 commit comments