Author: matz Date: Sat Dec 8 01:27:17 2007 New Revision: 8071 URL: http://svn.opensuse.org/viewcvs/zypp?rev=8071&view=rev Log: Let's make it compile, shall we? Modified: trunk/sat-solver/src/attr_store.c Modified: trunk/sat-solver/src/attr_store.c URL: http://svn.opensuse.org/viewcvs/zypp/trunk/sat-solver/src/attr_store.c?rev=8071&r1=8070&r2=8071&view=diff ============================================================================== --- trunk/sat-solver/src/attr_store.c (original) +++ trunk/sat-solver/src/attr_store.c Sat Dec 8 01:27:17 2007 @@ -257,12 +257,14 @@ #define pool_debug(a,b,...) fprintf (stderr, __VA_ARGS__) +static Id read_id (FILE *fp, Id max); + /* This routine is used only when attributes are embedded into the normal repo SOLV file. */ void add_attr_from_file (Attrstore *s, unsigned entry, Id name, int type, FILE *fp) { - Pool *pool = s->pool; + //Pool *pool = s->pool; //fprintf (stderr, "%s: attribute in a repo SOLV?\n", id2str (pool, name)); switch (type) { @@ -281,13 +283,18 @@ break; case TYPE_ATTR_STRING: { - char localbuf[1024]; - char c; - char *buf = localbuf; + unsigned char localbuf[1024]; + int c; + unsigned char *buf = localbuf; unsigned len = sizeof (localbuf); unsigned ofs = 0; - while((c = read_u8(fp)) != 0) + while((c = getc (fp)) != 0) { + if (c == EOF) + { + pool_debug (mypool, SAT_FATAL, "unexpected EOF\n"); + exit (1); + } /* Plus 1 as we also want to add the 0. */ if (ofs + 1 >= len) { @@ -303,7 +310,7 @@ buf[ofs++] = c; } buf[ofs++] = 0; - add_attr_string (s, entry, name, buf); + add_attr_string (s, entry, name, (char*) buf); if (buf != localbuf) xfree (buf); } -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org