[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 20:10:10 +0300 |
На Fri, 21 Aug 2009 17:38:04 +0300 Yavor Doganov <address@hidden> написа:
(On Fri, 21 Aug 2009 17:38:04 +0300 Yavor Doganov <address@hidden>
wrote:)
> Доста съм объркан от твоите коментари и неколкократния прочит на
> '(libc)Represenation of Strings'. Изглежда имам някакъв фундаментален
> пропуск тук. Преди да осмисля отговора ти, нима
>
> char *foo = "foo";
това е гарантирано да завършва на '\0', защото компилаторът ще замести
"foo" със {'f', 'o', 'o', '\0'}
Но това не е динамично заделена памет!
еквивалентът с malloc би бил:
char *foo = malloc(4);
foo[0] = 'f';
foo[1] = 'o';
foo[2] = 'o';
foo[3] = '\0';
ако програмистът не занули последния байт, няма кой друг да го направи.
В твоя код никъде няма зануляване след използването на g_malloc
Накратко:
xpcomPath = g_malloc (n);
strlen (xpcomPath);
ще има неясен (грешен) резултат, защото xpcomPath е с неизвестно
съдържание, а strlen очаква да прочете '\0'
- [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 <=
- 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, 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