Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Lucia Štefanková
notwork
Commits
82b9ff15
Commit
82b9ff15
authored
Apr 10, 2016
by
Matúš Sulír
Browse files
Fix like-text bugs
parent
2b5f2d67
Changes
1
Hide whitespace changes
Inline
Side-by-side
post.c
View file @
82b9ff15
...
...
@@ -34,15 +34,15 @@ void unlike_post(post_t *post) {
* post - the post of interest
* buf - a buffer at least 30 bytes long (if int is 64-bit)
*
* This function is a candidate for refactoring.
* This function is
intentionally awful - it is
a candidate for refactoring.
*/
char
*
like_count_text
(
post_t
*
post
,
char
*
buf
)
{
int
var1
=
post
->
like_count
;
int
var2
=
(
var1
==
1
);
sprintf
(
post
,
"%d"
,
var1
);
sprintf
(
buf
,
"%d
likes
"
,
var1
);
int
len
=
strlen
(
buf
);
if
(
var2
)
{
sprintf
(
post
,
"%d like"
,
var1
);
sprintf
(
buf
,
"%d like"
,
var1
);
}
return
buf
;
}
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment