aboutsummaryrefslogtreecommitdiffstats
path: root/fs/reiserfs
diff options
context:
space:
mode:
Diffstat (limited to 'fs/reiserfs')
-rw-r--r--fs/reiserfs/prints.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/fs/reiserfs/prints.c b/fs/reiserfs/prints.c
index 50ed4bd3ef63..b87b23717c23 100644
--- a/fs/reiserfs/prints.c
+++ b/fs/reiserfs/prints.c
@@ -157,19 +157,16 @@ static void sprintf_disk_child(char *buf, struct disk_child *dc)
157 dc_size(dc)); 157 dc_size(dc));
158} 158}
159 159
160static char *is_there_reiserfs_struct(char *fmt, int *what, int *skip) 160static char *is_there_reiserfs_struct(char *fmt, int *what)
161{ 161{
162 char *k = fmt; 162 char *k = fmt;
163 163
164 *skip = 0;
165
166 while ((k = strchr(k, '%')) != NULL) { 164 while ((k = strchr(k, '%')) != NULL) {
167 if (k[1] == 'k' || k[1] == 'K' || k[1] == 'h' || k[1] == 't' || 165 if (k[1] == 'k' || k[1] == 'K' || k[1] == 'h' || k[1] == 't' ||
168 k[1] == 'z' || k[1] == 'b' || k[1] == 'y' || k[1] == 'a') { 166 k[1] == 'z' || k[1] == 'b' || k[1] == 'y' || k[1] == 'a') {
169 *what = k[1]; 167 *what = k[1];
170 break; 168 break;
171 } 169 }
172 (*skip)++;
173 k++; 170 k++;
174 } 171 }
175 return k; 172 return k;
@@ -193,18 +190,15 @@ static void prepare_error_buf(const char *fmt, va_list args)
193 char *fmt1 = fmt_buf; 190 char *fmt1 = fmt_buf;
194 char *k; 191 char *k;
195 char *p = error_buf; 192 char *p = error_buf;
196 int i, j, what, skip; 193 int what;
197 194
198 strcpy(fmt1, fmt); 195 strcpy(fmt1, fmt);
199 196
200 while ((k = is_there_reiserfs_struct(fmt1, &what, &skip)) != NULL) { 197 while ((k = is_there_reiserfs_struct(fmt1, &what)) != NULL) {
201 *k = 0; 198 *k = 0;
202 199
203 p += vsprintf(p, fmt1, args); 200 p += vsprintf(p, fmt1, args);
204 201
205 for (i = 0; i < skip; i++)
206 j = va_arg(args, int);
207
208 switch (what) { 202 switch (what) {
209 case 'k': 203 case 'k':
210 sprintf_le_key(p, va_arg(args, struct reiserfs_key *)); 204 sprintf_le_key(p, va_arg(args, struct reiserfs_key *));