Funny crash in on Tiger
Funny crash in on Tiger
- Subject: Funny crash in on Tiger
- From: James Housley <email@hidden>
- Date: Mon, 27 Jun 2005 15:18:25 -0400
I am having problems with some code causing a crash on Tiger,
sometimes. If the code is compiled on Tiger it runs fine. If it is
compiled on 10.3.9 Development it is fine. If it is compiled
Deployment it will crash. Here are the code segments.
- (NSString *)makeUniqueString:(NSString *)filename aURL:(NSString
*)aURL
{
int x;
unsigned char out[MD5_DIGEST_LENGTH+1];
for (x = 0; x < 48; x++) out[x] = '\0';
NSString *source = [NSString stringWithFormat:@"Filename: %@, URL: %@,
Right now: %@", filename, aURL, [NSCalendarDate date]];
MD5((unsigned char *)[source cString], [source cStringLength], out);
NSMutableString *retVal = [[NSMutableString alloc]
initWithCapacity:64];
for (x = 0; x < 16; x++)
{
[retVal appendString:[NSString stringWithFormat:@"%.2X",
0x0FF&out[x]]];
}
return [[retVal retain] autorelease];
}
#define FeedsDictUniqueIdentifier @"UniqueIdentifier"
NSMutableDictionary *feed = [[NSMutableDictionary alloc]
initWithCapacity:1];
[feed setValue:[destinationFile lastPathComponent]
forKey:FeedsDictfeedFileName];
[feed setValue:[aURL absoluteString] forKey:FeedsDictfeedURL];
[feed setValue:[NSNumber numberWithInt:1]
forKey:FeedsDictphysicallyExists];
[feed setValue:[NSNumber numberWithInt:0]
forKey:FeedsDictisTransient];
NSString *uniqueString = [self makeUniqueString:[destinationFile
lastPathComponent] aURL:[aURL absoluteString]];
-->> [feed setValue:uniqueString forKey:FeedsDictUniqueIdentifier];
I tried using the intermediate string "uniqueString" and that seemed to
help in some places the code was being called. I have also messed with
what is returned from makeUniqueString:, but that hasn't helped. I
must be doing something wrong, but I can't figure it out. Any and all
pointers would be helpful.
Jim
--
/"\ ASCII Ribbon Campaign .
\ / - NO HTML/RTF in e-mail .
X - NO Word docs in e-mail .
/ \ -----------------------------------------------------------------
email@hidden http://www.FreeBSD.org The Power to Serve
email@hidden http://www.TheHousleys.net
---------------------------------------------------------------------
Q: Because it reverses the logical flow of conversation.
A: Why is putting a reply at the top of the message frowned upon?
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden