Index: src/OFApplication.m ================================================================== --- src/OFApplication.m +++ src/OFApplication.m @@ -258,11 +258,11 @@ "variable: %s\n", tmp.UTF8String); continue; } key = [tmp substringToIndex: pos]; - value = [tmp substringFromRange: pos + 1]; + value = [tmp substringFromIndex: pos + 1]; [_environment setObject: value forKey: key]; objc_autoreleasePoolPop(pool); Index: src/OFWindowsRegistryKey.m ================================================================== --- src/OFWindowsRegistryKey.m +++ src/OFWindowsRegistryKey.m @@ -359,12 +359,12 @@ void *pool = objc_autoreleasePoolPush(); OFData *data; if ([OFSystemInfo isWindowsNT]) data = [OFData dataWithItems: string.UTF16String - itemSize: sizeof(of_char16_t) - count: string.UTF16StringLength + 1]; + count: string.UTF16StringLength + 1 + itemSize: sizeof(of_char16_t)]; else { of_string_encoding_t encoding = [OFLocale encoding]; const char *cString = [string cStringWithEncoding: encoding]; size_t length = [string cStringLengthWithEncoding: encoding];