[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [kazehakase]: FTBFS под GNU/Hurd: mozilla.cpp:132: error: 'PATH_MAX'
From: |
Dimitur Kirov |
Subject: |
Re: [kazehakase]: FTBFS под GNU/Hurd: mozilla.cpp:132: error: 'PATH_MAX' was not declared in this scope |
Date: |
Fri, 21 Aug 2009 21:23:22 +0300 |
На Fri, 21 Aug 2009 20:48:46 +0300 Yavor Doganov <address@hidden> написа:
(On Fri, 21 Aug 2009 20:48:46 +0300 Yavor Doganov <address@hidden>
wrote:)
> > Накратко:
> > xpcomPath = g_malloc (n);
> > strlen (xpcomPath);
> > ще има неясен (грешен) резултат, защото xpcomPath е с неизвестно
> > съдържание, а strlen очаква да прочете '\0'
>
> Тук не си, струва ми се.
малко като малките деца започнахме :-)
ето моят пример, с малки добавки:
$ cat > foo.c <<'EOF'
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
int
main (void)
{
char *foo;
while (1) {
foo = g_malloc (3);
foo[0] = 'f';
foo[1] = 'o';
foo[2] = 'o';
if ( strlen(foo) != 3) {
g_debug ("ERROR");
exit (1);
} else {
g_debug ("TRUE");
}
g_free (foo);
}
return 0;
}
EOF
$ cc `pkg-config --cflags --libs glib-2.0` foo.c -o foo
$ ./foo
** (process:27419): DEBUG: TRUE
** (process:27419): DEBUG: ERROR
идеята е да има малко по-подробно писане и чистене на памет, за да може
отделни сегменти да се използват няколко пъти и тогава вече се вижда,
че никой не слага '\0' в края на низа. В програма като Kz паметта е
доста преизползвана и такъв проблем е неизбежен.
- [kazehakase]: FTBFS под GNU/Hurd: mozilla.cpp:132: error: 'PATH_MAX' was not declared in this scope, Yavor Doganov, 2009/08/20
- Re: [kazehakase]: FTBFS под GNU/Hurd: mozilla.cpp:132: error: 'PATH_MAX' was not declared in this scope, Dimitur Kirov, 2009/08/20
- Re: [kazehakase]: FTBFS под GNU/Hurd: mozilla.cpp:132: error: 'PATH_MAX' was not declared in this scope, Dimitur Kirov, 2009/08/20
- Re: [kazehakase]: FTBFS под GNU/Hurd: mozilla.cpp:132: error: 'PATH_MAX' was not declared in this scope, Yavor Doganov, 2009/08/21
- Re: [kazehakase]: FTBFS под GNU/Hurd: mozilla.cpp:132: error: 'PATH_MAX' was not declared in this scope, Dimitur Kirov, 2009/08/21
- Re: [kazehakase]: FTBFS под GNU/Hurd: mozilla.cpp:132: error: 'PATH_MAX' was not declared in this scope, Yavor Doganov, 2009/08/21
- Re: [kazehakase]: FTBFS под GNU/Hurd: mozilla.cpp:132: error: 'PATH_MAX' was not declared in this scope, Dimitur Kirov, 2009/08/21
- Re: [kazehakase]: FTBFS под GNU/Hurd: mozilla.cpp:132: error: 'PATH_MAX' was not declared in this scope, Yavor Doganov, 2009/08/21
- Re: [kazehakase]: FTBFS под GNU/Hurd: mozilla.cpp:132: error: 'PATH_MAX' was not declared in this scope,
Dimitur Kirov <=
- Re: [kazehakase]: FTBFS под GNU/Hurd: mozilla.cpp:132: error: 'PATH_MAX' was not declared in this scope, Yavor Doganov, 2009/08/21
- Re: [kazehakase]: FTBFS под GNU/Hurd: mozilla.cpp:132: error: 'PATH_MAX' was not declared in this scope, Dimitur Kirov, 2009/08/21
- Re: [kazehakase]: FTBFS под GNU/Hurd: mozilla.cpp:132: error: 'PATH_MAX' was not declared in this scope, Yavor Doganov, 2009/08/21
- Re: [kazehakase]: FTBFS под GNU/Hurd: mozilla.cpp:132: error: 'PATH_MAX' was not declared in this scope, Dimitur Kirov, 2009/08/21
- Re: [kazehakase]: FTBFS под GNU/Hurd: mozilla.cpp:132: error: 'PATH_MAX' was not declared in this scope, Dimitur Kirov, 2009/08/21
- Re: [kazehakase]: FTBFS под GNU/Hurd: mozilla.cpp:132: error: 'PATH_MAX' was not declared in this scope, Yavor Doganov, 2009/08/22
- Re: [kazehakase]: FTBFS под GNU/Hurd: mozilla.cpp:132: error: 'PATH_MAX' was not declared in this scope, Dimitur Kirov, 2009/08/22
- Re: [kazehakase]: FTBFS под GNU/Hurd: mozilla.cpp:132: error: 'PATH_MAX' was not declared in this scope, Yavor Doganov, 2009/08/23
- Re: [kazehakase]: FTBFS под GNU/Hurd: mozilla.cpp:132: error: 'PATH_MAX' was not declared in this scope, Yavor Doganov, 2009/08/21
Re: [kazehakase]: FTBFS под GNU/Hurd: mozilla.cpp:132: error: 'PATH_MAX' was not declared in this scope, Dimitur Kirov, 2009/08/20