--- plugins/check_nt.c.orig	2009-08-13 15:49:10.000000000 +0200
+++ plugins/check_nt.c	2009-08-13 16:51:25.000000000 +0200
@@ -97,6 +97,8 @@
 	char *temp_string_perf=NULL;
 	char *description=NULL,*counter_unit = NULL;
 	char *minval = NULL, *maxval = NULL, *errcvt = NULL;
+        char *fds=NULL;
+        char *tds=NULL;
 
 	double total_disk_space=0;
 	double free_disk_space=0;
@@ -217,34 +219,41 @@
 			output_message = strdup (_("wrong -l argument"));
 		else {
 			asprintf(&send_buffer,"%s&4&%s", req_password, value_list);
-			fetch_data (server_address, server_port, send_buffer);
-			free_disk_space=atof(strtok(recv_buffer,"&"));
-			total_disk_space=atof(strtok(NULL,"&"));
-			percent_used_space = ((total_disk_space - free_disk_space) / total_disk_space) * 100;
-			warning_used_space = ((float)warning_value / 100) * total_disk_space;
-			critical_used_space = ((float)critical_value / 100) * total_disk_space;
-
-			if (free_disk_space>=0) {
-				asprintf(&temp_string,_("%s:\\ - total: %.2f Gb - used: %.2f Gb (%.0f%%) - free %.2f Gb (%.0f%%)"),
-				  value_list, total_disk_space / 1073741824, (total_disk_space - free_disk_space) / 1073741824,
-				  percent_used_space, free_disk_space / 1073741824, (free_disk_space / total_disk_space)*100);
-				asprintf(&temp_string_perf,_("'%s:\\ Used Space'=%.2fGb;%.2f;%.2f;0.00;%.2f"), value_list,
-				  (total_disk_space - free_disk_space) / 1073741824, warning_used_space / 1073741824,
-				  critical_used_space / 1073741824, total_disk_space / 1073741824);
-
-				if(check_critical_value==TRUE && percent_used_space >= critical_value)
-					return_code=STATE_CRITICAL;
-				else if (check_warning_value==TRUE && percent_used_space >= warning_value)
-					return_code=STATE_WARNING;	
-				else
-					return_code=STATE_OK;	
-
-				output_message = strdup (temp_string);
-				perfdata = temp_string_perf;
+                        fetch_data (server_address, server_port, send_buffer);
+                        fds=strtok(recv_buffer,"&");
+                        tds=strtok(recv_buffer,"&");
+
+                        if (fds != NULL)
+                                free_disk_space=atof(fds);
+                        if (tds != NULL)
+                                total_disk_space=atof(tds);
+ 
+                        if (total_disk_space>0) {
+                                percent_used_space = ((total_disk_space - free_disk_space) / total_disk_space) * 100;
+                                warning_used_space = ((float)warning_value / 100) * total_disk_space;
+                                critical_used_space = ((float)critical_value / 100) * total_disk_space;
+ 
+                                if (free_disk_space>=0) {
+                                        asprintf(&temp_string,_("%s:\\ - total: %.2f Gb - used: %.2f Gb (%.0f%%) - free %.2f Gb (%.0f%%)"),
+                                          value_list, total_disk_space / 1073741824, (total_disk_space - free_disk_space) / 1073741824,
+                                          percent_used_space, free_disk_space / 1073741824, (free_disk_space / total_disk_space)*100);
+                                        asprintf(&temp_string_perf,_("'%s:\\ Used Space'=%.2fGb;%.2f;%.2f;0.00;%.2f"), value_list,
+                                          (total_disk_space - free_disk_space) / 1073741824, warning_used_space / 1073741824,
+                                          critical_used_space / 1073741824, total_disk_space / 1073741824);
+ 
+                                        if(check_critical_value==TRUE && percent_used_space >= critical_value)
+                                                return_code=STATE_CRITICAL;
+                                        else if (check_warning_value==TRUE && percent_used_space >= warning_value)
+                                                return_code=STATE_WARNING;
+                                        else
+                                                return_code=STATE_OK;
+ 
+                                        output_message = strdup (temp_string);
+                               }                                  
 			} else {
-				output_message = strdup (_("Free disk space : Invalid drive "));
-				return_code=STATE_UNKNOWN;
-			}
+                                        output_message = strdup (_("Free disk space : Invalid drive "));
+                                        return_code=STATE_UNKNOWN;
+                                }
 		}
 		break;
 
