harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexey Varlamov (JIRA)" <j...@apache.org>
Subject [jira] Commented: (HARMONY-6279) [classlib][luni] file.encoding is always set to ISO-9959-1 if using drlvm
Date Wed, 22 Jul 2009 04:44:15 GMT

    [ https://issues.apache.org/jira/browse/HARMONY-6279?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12733983#action_12733983
] 

Alexey Varlamov commented on HARMONY-6279:
------------------------------------------

Charles, I wonder what happens on Windows when you free static memory? ;)
Ok, let's brush it:
1) I would suggest more descriptive function name than charset() - say, like "getOSCharset()"
2) in linux file, variable definition is in the middle of a code block:
+  // get codeset from language[_territory][.codeset][@modifier]
+  char * locale = malloc(MAXBUFF * sizeof(char));
BTW, isn't sizeof(char) == 1 by definition? 
Also, might be reasonable to check for allocation result and for buffer overrun in the cycle.
3) in linux file, confusing check for return value - instead should be "if (!strlen(locale))"
I guess?
+  if (!locale) {
+    ret = NULL;
+  } else {
+    ret = locale;
+  }
4) in windows, strdup the return value for safe free
5) in windows file, would be nice to align the static map by pairs of columns, to improve
readability
6) in luniglob, it is wise to check the returned value for NULL and fallback to dummy default
like "8859_1"


> [classlib][luni] file.encoding is always set to ISO-9959-1 if using drlvm
> -------------------------------------------------------------------------
>
>                 Key: HARMONY-6279
>                 URL: https://issues.apache.org/jira/browse/HARMONY-6279
>             Project: Harmony
>          Issue Type: Bug
>            Reporter: Li Jing Qin
>         Attachments: HARMONY-6279.diff, HARMONY-6279.v2.diff
>
>
> Our file.encoding in the system property is always set 8859-1 if we using drlvm.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message