mitr is currently certified at Journeyer level.

Name: Miloslav Trmac
Member since: 2004-01-20 10:35:45
Last Login: 2008-12-18 00:50:06

FOAF RDF Share This

Notes:

Currently a student and a part-time sysadmin at Faculty of Mathematics and Physics of Charles University in Prague.

I work mainly on localization of GNOME and Fedora Core to Czech. My past projects include the UNIX clone.

Projects

Recent blog entries by mitr

Syndication: RSS 2.0
7 Nov 2004 (updated 13 Nov 2004 at 19:56 UTC) »

I have seen one too many instances of checking strtol () results wrong, so, for the record:

Update: Sigh, two too many, a portable check for empty input added.

To convert const char *str to a long, properly checking for overflow, invalid trailing characters and empty input, it is necessary to do the following:

char *p;
errno = 0;
result = strtol(str, &p, base);
if (errno != 0 || *p != 0 || p == str)
  error_handling ();

It is necessary to check both errno and *p; if you don't check errno, you get 0 for empty input and LONG_MAX or LONG_MIN for overflow or underflow. On empty input the return value is 0 and errno might be set to EINVAL; the portable way of checking for empty input is comparing p and str.

This will still accept strings that start with white space; check for !isspace((unsigned char)*str) if you want to reject them.

I hope that helps someone.

I was cleaning up cereal a bit and I contemplated replacing db2* (using openjade and DSSSL) with xmlto (using passivetex and XSLT). HTML generation went down from 6 s to 4 s, PDF generation up from 30 s to about 5 min.

Needless to say I'm staying with the DSSSL styles. At least I got a chance to fix some errors caught by the stricter XML parser used by xmlto.

Well, we (Charles University Prague) didn't win the ACM ICPC this year. I had fun anyway.

Installed current CVS GNOME and checked the translations (which turned out to be mostly fine). New GNOME looks really good. I can't wait for FC 2 with Bluecurvized GNOME 2.6; my eyes are too accustomed to the theme, which makes the work with Simple a bit uncomfortable.

A new release of cereal after six months, again with virtually no code changes.

Hopefully it will make the one or two people trying to build cereal on Gentoo happy.

5 older entries...

 

mitr certified others as follows:

  • mitr certified jkeating as Journeyer
  • mitr certified skvidal as Master
  • mitr certified alan as Master
  • mitr certified DV as Master
  • mitr certified Telsa as Journeyer
  • mitr certified malcolm as Master
  • mitr certified pnasrat as Journeyer
  • mitr certified Adrian as Master
  • mitr certified lewing as Master
  • mitr certified ncm as Master
  • mitr certified hadess as Journeyer
  • mitr certified vicious as Master
  • mitr certified mjw as Journeyer
  • mitr certified Spooky as Journeyer

Others have certified mitr as follows:

  • mterry certified mitr as Journeyer
  • lerdsuwa certified mitr as Apprentice
  • sashako certified mitr as Apprentice
  • ptk certified mitr as Apprentice
  • lkundrak certified mitr as Journeyer

[ Certification disabled because you're not logged in. ]

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!

X
Share this page