[drraw-users] Development spree..

Martin Schuster (IFKL IT OS DSM CD) Martin.Schuster1 at infineon.com
Mon Oct 6 01:17:41 MDT 2008


Christophe Kalt wrote:
> i'm hoping to finally complete work on version 2.2 over the
> next month or so.
> 
> therefore, this is a good time to speak up, and to send in any
> work you may have done on drraw.
>
ok, not a lot of real work, just blindly fixed two things that sometimes
threw warnings, spamming my httpd-error.log. Dunno if my fixes are sensible :)

Examples for the warnings:
drraw.cgi: Use of uninitialized value in string eq at /xxx/drraw.cgi line
2516., referer: https://xxx/drraw/?Browse=AllDashboards
drraw.cgi: Use of uninitialized value in numeric comparison (<=>) at
/.../drraw.cgi line 2874., referer:
https://xxx/drraw/?Mode=view;Dashboard=1219214010.12345



--- drraw_orig.cgi      2008-05-03 20:15:50.000000000 +0200
+++ drraw.cgi   2008-10-02 09:58:44.000000000 +0200
@@ -2513,8 +2513,10 @@
                                && $plist[0] !~ /^(g|t|d)/ ); # XXX Too vague..
         shift @plist;
     }
+
+    my $gform = param('gFormat');
     param('gFormat', 'PNG')
-        if ( param('gFormat') eq 'GIF' && $RRDs::VERSION >= 1.2 );
+        if ( defined($gform) && $gform eq 'GIF' && $RRDs::VERSION >= 1.2 );

     param('Code', 'Hide');
 }
@@ -2871,8 +2873,24 @@
 {
     my $seq = 1;
     my $ds;
-    foreach $ds ( sort { param("${a}_Seq") <=> param("${b}_Seq") }
-                  param('DS') ) {
+    foreach $ds ( sort {
+                       my $param_a =  param("${a}_Seq");
+                       my $param_b = param("${b}_Seq");
+                       if (defined($param_a)) {
+                               if (defined($param_b)) {
+                                       return ($param_a <=> $param_b);
+                               } else {
+                                       return -1;
+                               }
+                       } else {
+                               if (defined($param_b)) {
+                                       return (1);
+                               } else {
+                                       return 0;
+                               }
+                       }
+               }
+               param('DS') ) {
         if ( defined($DS{$ds}) ) {
             &Error("Discarded duplicate DS definition: $ds");
             next;



> _______________________________________________
> drraw-users mailing list
> drraw-users at taranis.org
> http://web.taranis.org/mailman/listinfo/drraw-users

-- 
Infineon Technologies IT-Services GmbH   Martin.Schuster1 at infineon.com
Lakeside B05, 9020 Klagenfurt, Austria   Martin Schuster
         FB: LG Klagenfurt, FN 246787y   +43 5 1777 3517



More information about the drraw-users mailing list