projects
/
rfk
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b6c01b1
)
fix bug about a negative direction
author
Thomas Thurman
<tthurman@gnome.org>
Sat, 22 Aug 2009 01:28:43 +0000
(21:28 -0400)
committer
Thomas Thurman
<tthurman@gnome.org>
Sat, 22 Aug 2009 01:28:43 +0000
(21:28 -0400)
rfk.c
patch
|
blob
|
history
diff --git
a/rfk.c
b/rfk.c
index
f9d997b
..
7a62ea8
100644
(file)
--- a/
rfk.c
+++ b/
rfk.c
@@
-158,7
+158,10
@@
ensure_messages_loaded (void)
while (!feof (nki_file))
{
char newline;
- fscanf (nki_file, "%a[^\n]%c", &line, &newline);
+ if (fscanf (nki_file, "%a[^\n]%c", &line, &newline) == EOF)
+ {
+ break;
+ }
if (strcmp(line, "")==0)
{
@@
-377,10
+380,9
@@
on_window_clicked (GtkWidget *widget,
angle = atan2(event->x - rx,
event->y - ry) +
- M_PI +
- M_PI/8;
+ M_PI * (9/8);
- move_robot (((int) (angle / (M_PI/4)))-1);
+ move_robot (((int) (angle / (M_PI/4))) % 8);
return TRUE;
}