Commit 09b3598
Daniel Thompson
kdb: Use format-strings rather than '\0' injection in kdb_read()
Currently when kdb_read() needs to reposition the cursor it uses copy and
paste code that works by injecting an '\0' at the cursor position before
delivering a carriage-return and reprinting the line (which stops at the
'\0').
Tidy up the code by hoisting the copy and paste code into an appropriately
named function. Additionally let's replace the '\0' injection with a
proper field width parameter so that the string will be abridged during
formatting instead.
Cc: [email protected] # Not a bug fix but it is needed for later bug fixes
Tested-by: Justin Stitt <[email protected]>
Reviewed-by: Douglas Anderson <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Daniel Thompson <[email protected]>1 parent e973074 commit 09b3598
1 file changed
Lines changed: 34 additions & 21 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
187 | 214 | | |
188 | 215 | | |
189 | 216 | | |
| |||
212 | 239 | | |
213 | 240 | | |
214 | 241 | | |
215 | | - | |
216 | 242 | | |
217 | 243 | | |
218 | 244 | | |
| |||
249 | 275 | | |
250 | 276 | | |
251 | 277 | | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
257 | | - | |
| 278 | + | |
| 279 | + | |
258 | 280 | | |
259 | 281 | | |
260 | 282 | | |
| |||
272 | 294 | | |
273 | 295 | | |
274 | 296 | | |
275 | | - | |
276 | | - | |
277 | | - | |
278 | | - | |
279 | | - | |
280 | | - | |
| 297 | + | |
| 298 | + | |
281 | 299 | | |
282 | 300 | | |
283 | 301 | | |
284 | 302 | | |
285 | | - | |
286 | | - | |
287 | 303 | | |
| 304 | + | |
288 | 305 | | |
289 | 306 | | |
290 | 307 | | |
| |||
390 | 407 | | |
391 | 408 | | |
392 | 409 | | |
393 | | - | |
| 410 | + | |
394 | 411 | | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
| 412 | + | |
400 | 413 | | |
401 | 414 | | |
402 | 415 | | |
| |||
0 commit comments