Skip to content

Commit

Permalink
2007-02-08 Krzysztof Kosciuszkiewicz <[email protected]>
Browse files Browse the repository at this point in the history
	* V127

	* Hunted down file descriptor leak

	* Removed NULL redefinition
  • Loading branch information
drvee committed Feb 8, 2007
1 parent 3b0a803 commit 26f3363
Show file tree
Hide file tree
Showing 11 changed files with 47 additions and 26 deletions.
2 changes: 0 additions & 2 deletions Buzz_inc.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,3 @@ int never_fail;
#include "macros.h" // Collected Macros

#define random brandom
#undef NULL
#define NULL 0
10 changes: 9 additions & 1 deletion ChangeLog
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
2007-02-08 Krzysztof Kosciuszkiewicz <[email protected]>

* V127

* Hunted down file descriptor leak

* Removed NULL redefinition

2007-02-08 Krzysztof Kosciuszkiewicz <[email protected]>

* V126

* Added SimpleHdr and SimpleHdrW to gamedata.c, changed rest of code to
use new interface

* Taken care about nasty bug related to structure packing and order of
* Taken care of a nasty bug related to structure packing and order of
includes

* Changed level of indentation for preprocessor macros to 0
Expand Down
2 changes: 2 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Organize this TODO file

Find the reason behind segfault in EndPict() in endgame.c

autosave

on a mission failure, replay mission doesn't show the explosion
Expand Down
30 changes: 21 additions & 9 deletions admin.c
Original file line number Diff line number Diff line change
Expand Up @@ -861,16 +861,15 @@ save_game (char *name)

if ((outf = sOpen (name, "wb", 1)) == NULL) {
printf ("save_game: can't create %s\n", name);
return;
goto cleanup;
}

size = fread_dyn(&buf, &buflen, inf);
fclose(inf);
inf = NULL;
if (size < 0) {
perror("save_game");
fclose (inf);
if (&buf)
free(&buf);
return;
goto cleanup;
}
hdr.compSize = size;

Expand All @@ -882,21 +881,34 @@ save_game (char *name)
if (size >= 0)
fwrite(buf, size, 1, outf);
else
{
perror("save_game");
fclose (inf);
goto cleanup;
}
fclose(inf);
inf = NULL;
}

if ((inf = sOpen ("EVENT.TMP", "rb", 1)) != NULL) {
size = fread_dyn(&buf, &buflen, inf);
if (size >= 0)
fwrite(buf, size, 1, outf);
else
{
perror("save_game");
fclose (inf);
goto cleanup;
}
fclose(inf);
inf = NULL;
}

fclose (outf);
free(buf);
cleanup:
if (outf)
fclose(outf);
if (inf)
fclose(inf);
if (buf)
free(buf);
}

char GetBlockName(char *Nam)
Expand Down
4 changes: 2 additions & 2 deletions budget.c
Original file line number Diff line number Diff line change
Expand Up @@ -454,10 +454,10 @@ void DrawVText(char got)
if (strncmp(&buf[0],"THIS CONCLUDES OUR NEWS",23)==0) grSetColor(11);
if (strncmp(&buf[0],"CHECK INTEL",11)==0) grSetColor(11);

while(buf[0]!='x'&& buf[0]!=NULL) {DispChr(buf[0]);buf++;};
while(buf[0]!='x'&& buf[0]!='\0') {DispChr(buf[0]);buf++;};
yy+=7;
buf++;
if (*buf==NULL) i=9;
if (*buf=='\0') i=9;
}

return;
Expand Down
14 changes: 7 additions & 7 deletions checkin2
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,17 @@ fi
msg=`cat ChangeLog |
sed -n -e "1{h;n}; /^[0-9]/{x;p}; /\<$lasttag\>/Q; /^[0-9]/!H"`

if [ $# -ne 0 ] ; then
# correct me if I'm wrong - it does not hurt to have same argument
# twice in cvs commit...
set -- "$@" $required_commits
fi

# diffstat output generation
diffstat=`which diffstat 2>&1`

echo "prev tag $lasttag; new tag $newtag"
if [ -e "$diffstat" ]
if [ -x "$diffstat" ]
then
echo "=== diffstat output ==="
cvs diff -r $lasttag "$@" | $diffstat -w 70
Expand All @@ -59,12 +65,6 @@ then
exit 1
fi

if [ $# -ne 0 ] ; then
# correct me if I'm wrong - it does not hurt to have same argument
# twice in cvs commit...
set -- "$@" $required_commits
fi

cvs -z9 commit -R -m "$msg" "$@"
if [ $? != 0 ]
then
Expand Down
1 change: 1 addition & 0 deletions endgame.c
Original file line number Diff line number Diff line change
Expand Up @@ -701,6 +701,7 @@ void SpecialEnd(void)

void EndPict(int x,int y,char poff,unsigned char coff)
{
/* XXX: game crashes in this function */
PatchHdr P;
GXHEADER local,local2;
unsigned int j;
Expand Down
2 changes: 1 addition & 1 deletion future.c
Original file line number Diff line number Diff line change
Expand Up @@ -995,7 +995,7 @@ void MissionName(int val,int xx,int yy,int len)
for (i=0;i<50;i++) {
if (j>len && Mis.Name[i]==' ') {yy+=7;j=0;grMoveTo(xx,yy);}
else DispChr(Mis.Name[i]);
j++;if (Mis.Name[i]==NULL) break;
j++;if (Mis.Name[i]=='\0') break;
};
return;
}
Expand Down
2 changes: 1 addition & 1 deletion mis_c.c
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,7 @@ char FailureMode(char plr,int prelim,char *text)
for (i=0;i<200;i++) {
if (j>40 && text[i]==' ') {k+=7;j=0;grMoveTo(12,k);}
else DispChr(text[i]);
j++;if (text[i]==NULL) break;
j++;if (text[i]=='\0') break;
};


Expand Down
4 changes: 2 additions & 2 deletions news.c
Original file line number Diff line number Diff line change
Expand Up @@ -506,14 +506,14 @@ DrawNText(char plr, char got)
if (strncmp(&buf[0], "CHECK THE TRACKING STATION", 26) == 0)
grSetColor((plr == 0) ? 9 : 7);

while (buf[0] != 'x' && buf[0] != NULL)
while (buf[0] != 'x' && buf[0] != '\0')
{
DispChr(buf[0]);
buf++;
};
yy += 9;
buf++;
if (*buf == NULL)
if (*buf == '\0')
i = 9;
}

Expand Down
2 changes: 1 addition & 1 deletion version.c
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
126
127

0 comments on commit 26f3363

Please sign in to comment.