Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
card10
firmware
Commits
79ec7d37
Verified
Commit
79ec7d37
authored
5 years ago
by
rahix
Browse files
Options
Downloads
Patches
Plain Diff
fix(pycardium): Fix stubbed snprintf messing up readline
Signed-off-by:
Rahix
<
rahix@rahix.de
>
parent
8ef77cdb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#1594
passed
5 years ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pycardium/patch.c
+16
-2
16 additions, 2 deletions
pycardium/patch.c
with
16 additions
and
2 deletions
pycardium/patch.c
+
16
−
2
View file @
79ec7d37
...
...
@@ -49,8 +49,22 @@ int puts(const char *s)
/* Used by mp_hal_move_cursor_back() */
int
snprintf
(
char
*
str
,
size_t
size
,
const
char
*
format
,
...)
{
/* TODO: What should we do with this? */
return
-
EIO
;
/*
* There is one known place where snprintf is used: The
* mp_hal_move_cursor_back() function from mp-readline.
* This stub implementation just implements printf for
* that one case.
*/
if
(
format
[
0
]
!=
'\x1B'
||
size
!=
6
)
{
return
-
EIO
;
}
va_list
ap
;
va_start
(
ap
,
format
);
printf
(
"
\x1B
[%uD"
,
va_arg
(
ap
,
unsigned
int
));
va_end
(
ap
);
return
-
1
;
}
/* Use by assert() */
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment