Bug#693249: RFS: etw/3.6+svn140-4 [RC] [ITA] arcade-style soccer game

2012-11-18 Thread Markus Koschany
On Sat, 17. Nov 17:25 Michael Gilbert mgilb...@debian.org wrote:
 Hi,
 
 I've just reviewed this, and it looks mostly good.  I did notice
 things like the following:
 
 + FILE *f;
 ++char path[1024];
 ++sprintf(path, %s/%s, getenv(HOME), .etw/etw.cfg );
 + D(bug(Reading configuration...\n/*-*/));
 
 Note that a hardcoded 1024 isn't very portable.  C defines PATH_MAX
 for this purpose.  Please use that instead.
 
Hi Michael,

thanks for taking the time to review the changes. Indeed the author of
etw already checks for PATH_MAX in etw.c and stores the result in
TEMP_DIR. On the other hand he uses 1024 bytes for the buffer at most
and truncates the rest if it exceeds this limit. You can find the
relevant part at line 800 and the following lines in menu.c.

Thanks for pointing this out. I've changed the code accordingly.

+--- a/etw/menu_config.c
 b/etw/menu_config.c
+@@ -392,9 +392,16 @@ void load_config(FILE *f)
+ void read_menu_config(void)
+ {
+ FILE *f;
++char path[1024];
++snprintf(path, 1024, %setw.cfg, TEMP_DIR);
++
+ D(bug(Reading configuration...\n/*-*/));
+ 
+-f=fopen(etw.cfg/*-*/,r);
++f=fopen(path/*-*/,r);
++
++if (f == NULL) {
++  f=fopen(etw.cfg/*-*/,r);
++}


I've uploaded the new version to mentors.debian.net and attached the complete 
debdiff to
bug report #693244. 

Regards,

Markus


signature.asc
Description: Digital signature


Bug#693249: RFS: etw/3.6+svn140-4 [RC] [ITA] arcade-style soccer game

2012-11-18 Thread Michael Gilbert
On Sun, Nov 18, 2012 at 9:21 AM, Markus Koschany wrote:
 thanks for taking the time to review the changes. Indeed the author of
 etw already checks for PATH_MAX in etw.c and stores the result in
 TEMP_DIR. On the other hand he uses 1024 bytes for the buffer at most
 and truncates the rest if it exceeds this limit. You can find the
 relevant part at line 800 and the following lines in menu.c.

 Thanks for pointing this out. I've changed the code accordingly.

 +--- a/etw/menu_config.c
  b/etw/menu_config.c
 +@@ -392,9 +392,16 @@ void load_config(FILE *f)
 + void read_menu_config(void)
 + {
 + FILE *f;
 ++char path[1024];
 ++snprintf(path, 1024, %setw.cfg, TEMP_DIR);
 ++
 + D(bug(Reading configuration...\n/*-*/));
 +
 +-f=fopen(etw.cfg/*-*/,r);
 ++f=fopen(path/*-*/,r);
 ++
 ++if (f == NULL) {
 ++  f=fopen(etw.cfg/*-*/,r);
 ++}

snprintf is a much better choice. Thanks!

I tried to build, but got an error: undefined reference to 'atan2'.  I
think your linker flags are missing '-lm'?

Best wishes,
Mike


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/CANTw=MNyAWVndrdhPSSUDeh7Q1nmF4k+n8FFobC-o==f=cW=0...@mail.gmail.com



Bug#693249: RFS: etw/3.6+svn140-4 [RC] [ITA] arcade-style soccer game

2012-11-18 Thread Markus Koschany
On Sun, 18. Nov 19:20 Michael Gilbert mgilb...@debian.org wrote:
 I tried to build, but got an error: undefined reference to 'atan2'.  I
 think your linker flags are missing '-lm'?

That's strange. How did you try to build etw? Did you use the package at
mentors.debian.net?

https://mentors.debian.net/package/etw

I have never seen this error before with etw. I use pbuilder/cowbuilder and it 
builds just
fine here on amd64 and i386.

Cheers,

Markus



signature.asc
Description: Digital signature


Bug#693249: RFS: etw/3.6+svn140-4 [RC] [ITA] arcade-style soccer game

2012-11-17 Thread Michael Gilbert
On Wed, Nov 14, 2012 at 12:58 PM, Markus Koschany  wrote:
 Changes since the last upload:

 * New Maintainer. (Closes: #544922)
 * Eat the Whistle will be maintained in a Git repository from now
   on. Change the Vcs-fields in debian/control accordingly.
 * debian/patches:
   Add 0005-Change-conf-and-replay-path.patch.
   Save and load configuration and replays in $HOME/.etw/ instead of
   /usr/share/games/etw and stop failing silently. (Closes: #693244)

Hi,

I've just reviewed this, and it looks mostly good.  I did notice
things like the following:

+ FILE *f;
++char path[1024];
++sprintf(path, %s/%s, getenv(HOME), .etw/etw.cfg );
+ D(bug(Reading configuration...\n/*-*/));

Note that a hardcoded 1024 isn't very portable.  C defines PATH_MAX
for this purpose.  Please use that instead.

Thanks,
Mike


-- 
To UNSUBSCRIBE, email to debian-mentors-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org
Archive: 
http://lists.debian.org/CANTw=MPGyNE3Rg83TA4_vBC0ndmALU0a6JzMbB0=49p3eef...@mail.gmail.com



Bug#693249: RFS: etw/3.6+svn140-4 [RC] [ITA] arcade-style soccer game

2012-11-17 Thread Adam Borowski
On Sat, Nov 17, 2012 at 05:25:35PM -0500, Michael Gilbert wrote:
 I've just reviewed this, and it looks mostly good.  I did notice
 things like the following:
 
 + FILE *f;
 ++char path[1024];
 ++sprintf(path, %s/%s, getenv(HOME), .etw/etw.cfg );
 + D(bug(Reading configuration...\n/*-*/));
 
 Note that a hardcoded 1024 isn't very portable.  C defines PATH_MAX
 for this purpose.  Please use that instead.

1024 is more portable than PATH_MAX...

This define should have died a couple of decades ago, and it's kept only for
compat purposes.  If you use it, you'll get a FTBFS on Hurd, as they decided
to force the issue and get rid of the blighter.

You can sometimes get suggestions to use pathconf(_PC_PATH_MAX), which is
even worse, as you'd be dynamically allocating a static buffer.


And obviously, the code above has a buffer overflow, no matter if you use
1024 bytes or PATH_MAX.  You'd want asprintf() or an equivalent.

-- 
How to squander your resources: those silly Swedes have a sauce named
hovmästarsås, the best thing ever to put on cheese, yet they waste it
solely on mere salmon.


signature.asc
Description: Digital signature


Bug#693249: RFS: etw/3.6+svn140-4 [RC] [ITA] arcade-style soccer game

2012-11-16 Thread Markus Koschany
I had to revert the part of the change which enabled saving and loading
of replays in the user's home directory because i have discovered another way to
trigger a segfault by pressing SPACE while watching a replay.

This feature is way too buggy at the moment. Instead i've updated 
README.Debian and explained why the replay function doesn't work.

Loading and saving of the configuration is working as intended and
should still be made available for wheezy.

Regards,

Markus


signature.asc
Description: Digital signature


Bug#693249: RFS: etw/3.6+svn140-4 [RC] [ITA] arcade-style soccer game

2012-11-14 Thread Markus Koschany
Package: sponsorship-requests
Severity: important 

Dear mentors,

I am looking for a sponsor for my package etw which i intend to adopt.
While i was preparing a new version i discovered that the configuration
can't be saved permanently. This impairs strongly the overall usability
of the game.

The first part of the patch restores the ability to load the
configuration from $HOME/.etw and to save options permanently.

The second part deals in a similar manner with the replay function.
From now on replays can be saved in $HOME/.etw. Unfortunately the replay
function suffers from another bug which is limited to the game's arcade
mode though. The game will segfault reproducibly if you try to view a replay
which was recorded while playing in arcade mode.
Other modes are not affected.


Package name: etw
Version : 3.6+svn140-4
Upstream Author : Gabriele Greco gabrielegr...@gmail.com
URL : http://www.ggsoft.org/etw/
License : GPL-2+
Section : games

It builds those binary packages:

etw   - arcade-style soccer game
etw-data   - graphics and audio data for etw

To access further information about this package, please visit the following 
URL:

http://mentors.debian.net/package/etw

and http://bugs.debian.org/693244


Alternatively, one can download the package with dget using this command:

dget -x http://mentors.debian.net/debian/pool/main/e/etw/etw_3.6+svn140-4.dsc


Changes since the last upload:

* New Maintainer. (Closes: #544922)
* Eat the Whistle will be maintained in a Git repository from now
  on. Change the Vcs-fields in debian/control accordingly.
* debian/patches: 
  Add 0005-Change-conf-and-replay-path.patch.
  Save and load configuration and replays in $HOME/.etw/ instead of
  /usr/share/games/etw and stop failing silently. (Closes: #693244)

Regards,

Markus Koschany



signature.asc
Description: Digital signature