- Fix usetprivate

This commit is contained in:
Christian Schlittchen 2001-02-18 09:32:13 +00:00
parent 2854c15075
commit 4c02ee9c20
3 changed files with 9 additions and 4 deletions

View File

@ -20,7 +20,7 @@ CTAGSFLAGS = --langmap=c:.c.h --c-types=-m
CFLAGS = -I$(ERESSEA) -Wall -Wwrite-strings -Wstrict-prototypes \
-Wpointer-arith -Werror-implicit-function-declaration \
-Wno-char-subscripts \
-march=pentiumpro -fPIC $(INCLUDES)
-march=pentiumpro $(INCLUDES)
LDFLAGS = $(LIBS)
LIBS = -L$(PUBLISH_DIR)

View File

@ -1,6 +1,6 @@
/* vi: set ts=2:
*
* $Id: laws.c,v 1.24 2001/02/17 16:07:02 enno Exp $
* $Id: laws.c,v 1.25 2001/02/18 09:32:13 corwin Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de)
@ -1864,6 +1864,7 @@ instant_orders(void)
for (r = regions; r; r = r->next)
for (u = r->units; u; u = u->next) {
printf("Unit: %s\n", itoa36(u->no));
#ifdef GROUPS
for (S = u->orders; S; S = S->next)
{

View File

@ -1,6 +1,6 @@
/* vi: set ts=2:
*
* $Id: unit.c,v 1.5 2001/02/10 14:18:00 enno Exp $
* $Id: unit.c,v 1.6 2001/02/18 09:32:13 corwin Exp $
* Eressea PB(E)M host Copyright (C) 1998-2000
* Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de)
@ -213,7 +213,11 @@ uprivate(const unit * u) {
void
usetprivate(unit * u, const char * str) {
attrib * a = a_find(u->attribs, &at_private);
if (!a && !str) return;
if(str == NULL) {
if(a) a_remove(&u->attribs, a);
return;
}
if (!a) a = a_add(&u->attribs, a_new(&at_private));
if (a->data.v) free(a->data.v);
a->data.v = strdup(str);