+ int len;
+ char buffer[256], *datestr, *depth, *duration;
+ struct tm *tm;
+
+ tm = gmtime(&dive->when);
+ len = snprintf(buffer, sizeof(buffer),
+ "%02d.%02d.%02d %02d:%02d",
+ tm->tm_mday, tm->tm_mon+1, tm->tm_year % 100,
+ tm->tm_hour, tm->tm_min);
+ datestr = malloc(len+1);
+ memcpy(datestr, buffer, len+1);
+
+ len = snprintf(buffer, sizeof(buffer),
+ "%d", to_feet(dive->maxdepth));
+ depth = malloc(len + 1);
+ memcpy(depth, buffer, len+1);
+
+ len = snprintf(buffer, sizeof(buffer),
+ "%d", dive->duration.seconds / 60);
+ duration = malloc(len + 1);
+ memcpy(duration, buffer, len+1);
+