Index: src/OFApplication.m ================================================================== --- src/OFApplication.m +++ src/OFApplication.m @@ -117,11 +117,11 @@ OFString *value; char *sep; if ((sep = strchr(*env, '=')) == NULL) { fprintf(stderr, "Warning: Invalid environment " - "variable: %s\n", *env); + "variable: %s\n", *env); continue; } key = [OFString stringWithCString: *env length: sep - *env]; Index: src/OFExceptions.m ================================================================== --- src/OFExceptions.m +++ src/OFExceptions.m @@ -498,12 +498,12 @@ { if (description != nil) return description; description = [[OFString alloc] initWithFormat: - @"Failed to open file %s with mode %s in class %s! " ERRFMT, - [path cString], [mode cString], class_getName(inClass), ERRPARAM]; + @"Failed to open file %@ with mode %@ in class %s! " ERRFMT, path, + mode, class_getName(inClass), ERRPARAM]; return description; } - (int)errNo @@ -663,12 +663,12 @@ { if (description != nil) return description; description = [[OFString alloc] initWithFormat: - @"Failed to create directory %s in class %s! " ERRFMT, - [path cString], class_getName(inClass), ERRPARAM]; + @"Failed to create directory %@ in class %s! " ERRFMT, path, + class_getName(inClass), ERRPARAM]; return description; } - (int)errNo @@ -725,12 +725,12 @@ { if (description != nil) return description; description = [[OFString alloc] initWithFormat: - @"Failed to change to directory %s in class %s! " ERRFMT, - [path cString], class_getName(inClass), ERRPARAM]; + @"Failed to change to directory %@ in class %s! " ERRFMT, path, + class_getName(inClass), ERRPARAM]; return description; } - (int)errNo @@ -792,12 +792,12 @@ { if (description != nil) return description; description = [[OFString alloc] initWithFormat: - @"Failed to change mode for file %s to %d in class %s! " ERRFMT, - [path cString], mode, class_getName(inClass), ERRPARAM]; + @"Failed to change mode for file %@ to %d in class %s! " ERRFMT, + path, mode, class_getName(inClass), ERRPARAM]; return description; } - (int)errNo @@ -871,23 +871,21 @@ if (description != nil) return description; if (group == nil) description = [[OFString alloc] initWithFormat: - @"Failed to change owner for file %s to %s in class %s! " - ERRFMT, [path cString], [owner cString], - class_getName(inClass), ERRPARAM]; + @"Failed to change owner for file %@ to %@ in class %s! " + ERRFMT, path, owner, class_getName(inClass), ERRPARAM]; else if (owner == nil) description = [[OFString alloc] initWithFormat: - @"Failed to change group for file %s to %s in class %s! " - ERRFMT, [path cString], [group cString], - class_getName(inClass), ERRPARAM]; + @"Failed to change group for file %@ to %@ in class %s! " + ERRFMT, path, group, class_getName(inClass), ERRPARAM]; else description = [[OFString alloc] initWithFormat: - @"Failed to change owner for file %s to %s:%s in class %s! " - ERRFMT, [path cString], [owner cString], [group cString], - class_getName(inClass), ERRPARAM]; + @"Failed to change owner for file %@ to %@:%@ in class %s! " + ERRFMT, path, owner, group, class_getName(inClass), + ERRPARAM]; return description; } - (int)errNo @@ -960,13 +958,12 @@ { if (description != nil) return description; description = [[OFString alloc] initWithFormat: - @"Failed to copy file %s to %s in class %s! " ERRFMT, - [sourcePath cString], [destinationPath cString], - class_getName(inClass), ERRPARAM]; + @"Failed to copy file %@ to %@ in class %s! " ERRFMT, + sourcePath, destinationPath, class_getName(inClass), ERRPARAM]; return description; } - (int)errNo @@ -1033,13 +1030,12 @@ { if (description != nil) return description; description = [[OFString alloc] initWithFormat: - @"Failed to rename file %s to %s in class %s! " ERRFMT, - [sourcePath cString], [destinationPath cString], - class_getName(inClass), ERRPARAM]; + @"Failed to rename file %@ to %@ in class %s! " ERRFMT, sourcePath, + destinationPath, class_getName(inClass), ERRPARAM]; return description; } - (int)errNo @@ -1101,11 +1097,11 @@ { if (description != nil) return description; description = [[OFString alloc] initWithFormat: - @"Failed to delete file %s in class %s! " ERRFMT, [path cString], + @"Failed to delete file %@ in class %@! " ERRFMT, path, class_getName(inClass), ERRPARAM]; return description; } @@ -1163,12 +1159,12 @@ { if (description != nil) return description; description = [[OFString alloc] initWithFormat: - @"Failed to delete directory %s in class %s! " ERRFMT, - [path cString], class_getName(inClass), ERRPARAM]; + @"Failed to delete directory %@ in class %@! " ERRFMT, path, + class_getName(inClass), ERRPARAM]; return description; } - (int)errNo @@ -1226,13 +1222,12 @@ { if (description != nil) return description; description = [[OFString alloc] initWithFormat: - @"Failed to link file %s to %s in class %s! " ERRFMT, - [sourcePath cString], [destinationPath cString], - class_getName(inClass), ERRPARAM]; + @"Failed to link file %@ to %@ in class %s! " ERRFMT, sourcePath, + destinationPath, class_getName(inClass), ERRPARAM]; return description; } - (int)errNo @@ -1294,13 +1289,12 @@ { if (description != nil) return description; description = [[OFString alloc] initWithFormat: - @"Failed to symlink file %s to %s in class %s! " ERRFMT, - [sourcePath cString], [destinationPath cString], - class_getName(inClass), ERRPARAM]; + @"Failed to symlink file %@ to %@ in class %s! " ERRFMT, sourcePath, + destinationPath, class_getName(inClass), ERRPARAM]; return description; } - (int)errNo @@ -1411,17 +1405,17 @@ if (description != nil) return description; if (node != nil && service != nil) description = [[OFString alloc] initWithFormat: - @"The service %s on %s could not be translated to an " + @"The service %@ on %@ could not be translated to an " @"address in class %s. This means that either the node was " @"not found, there is no such service on the node, there " @"was a problem with the name server, there was a problem " @"with your network connection or you specified an invalid " - @"node or service. " ERRFMT, [service cString], - [node cString], class_getName(inClass), AT_ERRPARAM]; + @"node or service. " ERRFMT, service, node, + class_getName(inClass), AT_ERRPARAM]; else description = [[OFString alloc] initWithFormat: @"An address translation failed in class %s! " ERRFMT, class_getName(inClass), AT_ERRPARAM]; @@ -1492,13 +1486,13 @@ { if (description != nil) return description; description = [[OFString alloc] initWithFormat: - @"A connection to service %s on node %s could not be established " - @"in class %s! " ERRFMT, [service cString], [node cString], - class_getName(inClass), ERRPARAM]; + @"A connection to service %@ on node %@ could not be established " + @"in class %s! " ERRFMT, service, node, class_getName(inClass), + ERRPARAM]; return description; } - (int)errNo @@ -1565,13 +1559,12 @@ { if (description != nil) return description; description = [[OFString alloc] initWithFormat: - @"Binding service %s on node %s failed in class %s! " ERRFMT, - [service cString], [node cString], class_getName(inClass), - ERRPARAM]; + @"Binding service %@ on node %@ failed in class %s! " ERRFMT, + service, node, class_getName(inClass), ERRPARAM]; return description; } - (int)errNo @@ -1816,16 +1809,16 @@ if (description != nil) return description; if (ns != nil) description = [[OFString alloc] initWithFormat: - @"The namespace %s is not bound in class %s", + @"The namespace %@ is not bound in class %s", ns, class_getName(inClass)]; else if (prefix != nil) description = [[OFString alloc] initWithFormat: - @"The prefix %s is not bound to any namespace in %s", - class_getName(inClass)]; + @"The prefix %@ is not bound to any namespace in %s", + prefix, class_getName(inClass)]; return description; } - (OFString*)namespace @@ -1881,16 +1874,16 @@ { if (description != nil) return description; description = [[OFString alloc] initWithFormat: - @"The protocol of URL %s is not supported by class %s", - [[URL description] cString], class_getName(inClass)]; + @"The protocol of URL %@ is not supported by class %s", URL, + class_getName(inClass)]; return description; } - (OFURL*)URL { return URL; } @end Index: src/OFObject.m ================================================================== --- src/OFObject.m +++ src/OFObject.m @@ -489,12 +489,11 @@ } - (OFString*)description { /* Classes containing data should reimplement this! */ - return [OFString stringWithFormat: @"<%s: %p>", - [[self className] cString], self]; + return [OFString stringWithFormat: @"<%@: %p>", [self className], self]; } - (void)addMemoryToPool: (void*)ptr { void **memchunks; Index: src/OFURL.m ================================================================== --- src/OFURL.m +++ src/OFURL.m @@ -351,19 +351,18 @@ [old release]; } - (OFString*)description { - OFMutableString *desc = [OFMutableString - stringWithFormat: @"%s://", [scheme cString]]; + OFMutableString *desc = [OFMutableString stringWithFormat: @"%@://", + scheme]; BOOL needPort = YES; if (user != nil && password != nil) - [desc appendFormat: @"%s:%s@", [user cString], - [password cString]]; + [desc appendFormat: @"%@:%@@", user, password]; else if (user != nil) - [desc appendFormat: @"%s@", [user cString]]; + [desc appendFormat: @"%@@", user]; [desc appendString: host]; if (([scheme isEqual: @"http"] && port == 80) || ([scheme isEqual: @"https"] && port == 443)) @@ -371,19 +370,19 @@ if (needPort) [desc appendFormat: @":%d", port]; if (path != nil) - [desc appendFormat: @"/%s", [path cString]]; + [desc appendFormat: @"/%@", path]; if (parameters != nil) - [desc appendFormat: @";%s", [parameters cString]]; + [desc appendFormat: @";%@", parameters]; if (query != nil) - [desc appendFormat: @"?%s", [query cString]]; + [desc appendFormat: @"?%@", query]; if (fragment != nil) - [desc appendFormat: @"#%s", [fragment cString]]; + [desc appendFormat: @"#%@", fragment]; return desc; } @end Index: src/OFXMLElement.m ================================================================== --- src/OFXMLElement.m +++ src/OFXMLElement.m @@ -209,12 +209,11 @@ if (characters != nil) return [characters stringByXMLEscaping]; if (cdata != nil) - return [OFString stringWithFormat: @"", - [cdata cString]]; + return [OFString stringWithFormat: @"", cdata]; if (comment != nil) { OFMutableString *str; str = [OFMutableString stringWithString: @"