* [devel] libytnef
@ 2010-07-14 4:46 Yuri N. Sedunov
2010-07-14 5:07 ` Damir Shayhutdinov
0 siblings, 1 reply; 3+ messages in thread
From: Yuri N. Sedunov @ 2010-07-14 4:46 UTC (permalink / raw)
To: devel
Не подскажет ли уважаемое сообщество, как правильно поправить сей кусок
кода?
> 320 unsigned char *DecompressRTF(variableLength *p, int *size) {
> 1321 unsigned char *dst; // destination for uncompressed bytes
> 1322 unsigned char *src;
> 1323 unsigned int in;
> 1324 unsigned int out;
> 1325 int i;
> 1326 variableLength comp_Prebuf;
> 1327 ULONG compressedSize, uncompressedSize, magic, crc32;
> 1328
> 1329 comp_Prebuf.size = strlen(RTF_PREBUF);
> 1330 comp_Prebuf.data = calloc(comp_Prebuf.size, 1);
> 1331 strcpy(comp_Prebuf.data, RTF_PREBUF);
> 1332
> 1333 src = p->data;
> 1334 in = 0;
> 1335
> 1336 compressedSize = (ULONG)SwapDWord(src+in);
> 1337 in += 4;
> 1338 uncompressedSize = (ULONG)SwapDWord(src+in);
--
Yuri N. Sedunov
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [devel] libytnef
2010-07-14 4:46 [devel] libytnef Yuri N. Sedunov
@ 2010-07-14 5:07 ` Damir Shayhutdinov
2010-07-15 3:20 ` Yuri N. Sedunov
0 siblings, 1 reply; 3+ messages in thread
From: Damir Shayhutdinov @ 2010-07-14 5:07 UTC (permalink / raw)
To: ALT Linux Team development discussions
> Не подскажет ли уважаемое сообщество, как правильно поправить сей кусок
> кода?
>> 320 unsigned char *DecompressRTF(variableLength *p, int *size) {
>> 1321 unsigned char *dst; // destination for uncompressed bytes
>> 1322 unsigned char *src;
>> 1323 unsigned int in;
>> 1324 unsigned int out;
>> 1325 int i;
>> 1326 variableLength comp_Prebuf;
>> 1327 ULONG compressedSize, uncompressedSize, magic, crc32;
>> 1328
>> 1329 comp_Prebuf.size = strlen(RTF_PREBUF);
>> 1330 comp_Prebuf.data = calloc(comp_Prebuf.size, 1);
>> 1331 strcpy(comp_Prebuf.data, RTF_PREBUF);
Правильное решение зависит от сематики поля size.
Если я правильно угадал, что это поле означает - тогда так
1329 comp_Prebuf.size = strlen(RTF_PREBUF) + 1;
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [devel] libytnef
2010-07-14 5:07 ` Damir Shayhutdinov
@ 2010-07-15 3:20 ` Yuri N. Sedunov
0 siblings, 0 replies; 3+ messages in thread
From: Yuri N. Sedunov @ 2010-07-15 3:20 UTC (permalink / raw)
To: ALT Linux Team development discussions
В Срд, 14/07/2010 в 09:07 +0400, Damir Shayhutdinov пишет:
> > Не подскажет ли уважаемое сообщество, как правильно поправить сей кусок
> > кода?
> >> 320 unsigned char *DecompressRTF(variableLength *p, int *size) {
> >> 1321 unsigned char *dst; // destination for uncompressed bytes
> >> 1322 unsigned char *src;
> >> 1323 unsigned int in;
> >> 1324 unsigned int out;
> >> 1325 int i;
> >> 1326 variableLength comp_Prebuf;
> >> 1327 ULONG compressedSize, uncompressedSize, magic, crc32;
> >> 1328
> >> 1329 comp_Prebuf.size = strlen(RTF_PREBUF);
> >> 1330 comp_Prebuf.data = calloc(comp_Prebuf.size, 1);
> >> 1331 strcpy(comp_Prebuf.data, RTF_PREBUF);
> Правильное решение зависит от сематики поля size.
>
> Если я правильно угадал, что это поле означает - тогда так
> 1329 comp_Prebuf.size = strlen(RTF_PREBUF) + 1;
Спасибо.
--
Yuri N. Sedunov
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-07-15 3:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-14 4:46 [devel] libytnef Yuri N. Sedunov
2010-07-14 5:07 ` Damir Shayhutdinov
2010-07-15 3:20 ` Yuri N. Sedunov
ALT Linux Team development discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git
# If you have public-inbox 1.1+ installed, you may
# initialize and index your mirror using the following commands:
public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
public-inbox-index devel
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.devel
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git